Keith
Registered User.
- Local time
- Today, 02:17
- Joined
- May 21, 2000
- Messages
- 129
Trying to update a table using vba. I have a problem on how to get quotes around a string variable in the sql statement. when the sql executes I get a popup asking for parameter for whatever word the variable is. If I enter the word the table is updated.
The sql string is:
The result in the immediate window is:
The sql string is:
Code:
sql = "UPDATE tblMemberBranch SET tblMemberBranch.Test = " & res & _
" WHERE (([tblMemberBranch].[MemberBranchID]= " & OpenArgs & " ));"
Code:
Print OpenArgs = 1
Print res = Chairman
Print sql = UPDATE tblMemberBranch SET tblMemberBranch.Test = Chairman _
WHERE (([tblMemberBranch].[MemberBranchID]= 1 ));