-
I have a database with two tables. I need to update one with and agency name. The other holds the agency names and ID numbers. How do I search the second table by ID number and to update the agency field in the first table? I tried this
strCriteria = "SELECT Agency_Name FROM Identification WHERE ACH_ID = "'" & IDNUM "'" '
But it doesn't work. I know little about SQL I am just trying it out. What am I doing wrong? Also, please be clear about the ' and " because it is hard to see them on the message board.
-
What error are you getting with this?
Bash
-
The SQL should read as follows:
strCriteria = "SELECT Agency_Name FROM Identification
WHERE ACH_ID = '" & IDNUM & "'"
OR
strCriteria = "SELECT Agency_Name FROM Identification WHERE ACH_ID = " & IDNUM
Either one of these should work.
Hope this helps
David Ridgway
[email protected]
-
I'll re-send the reply and space out the one that uses ' and "".
strCriteria = "SELECT Agency_Name
FROM Identification
WHERE ACH_ID = ' " & IDNUM & " ' "
Hope this helps
David Ridgway
[email protected]