Problem adding ( " ) at the end of the string

Ammarhm

Beginner User
Local time
Today, 00:21
Joined
Jul 3, 2008
Messages
80
Hi guys
Need som help with a thing
I am trying to use the DoCmd.RunSQL command and put a string after it like this:

sqlString="update [Order Details] set [UnitPrice] = "& var1 & "where OrderID = " & var2 & ";"
DoCmd.RunSQL sqlString

My problem is the following:
as you know there has to be a citation mark ( " ) at the end of the string or the command to run
How do i add a ( " ) at the end of the string please?? I can not write the following as the system dose not accept it
sqlString="update [Order Details] set [UnitPrice] = "& var1 & "where OrderID = " & var2 & ";""
so is there any ASCI code or any other code that can be used to add a ( " ) at the end of the string??
Thanks all
 
You do not need to have " at the end of the string (not sure where you got that from)

This should work:

sqlString="Update [Order Details] set [UnitPrice] = " & var1 & " where OrderID = " & var2

You just are missing some spaces and you don't need the ";" part at the end.
 

Users who are viewing this thread

Back
Top Bottom