gmaxey
01-06-2016, 12:24 PM
I have a database table with 5 fields:
ID
Client
Platform
ProjectManager
ProjectEngineer
I a trying to update a specific fields using the following SQL statement (e.g, the field with the ID value = 13:
modMain.UpdateAccess "Update RigData SET Platform='XXX', ProjectManager=YYY', ProjectEngineer='ZZZ' WHERE ID='13';"
However, when I do I get the following error:
"Data type mismatch in criteria expression"
I think this error is due to the ID fields being an AutoNumber type because if I change the SQL statement as follows it runs without error:
Chevon is a value in the Client column. The problem is that there are several records with Client= "Chevron" and I only want to update the one wit the ID value = 13
'modMain.UpdateAccess "Update RigData SET Platform='XXX', ProjectManager='YYY', ProjectEngineer='ZZZ' WHERE Client='Chevron';"
Can someone please explain how to make this work or offer and alternate method? Thank you.
ID
Client
Platform
ProjectManager
ProjectEngineer
I a trying to update a specific fields using the following SQL statement (e.g, the field with the ID value = 13:
modMain.UpdateAccess "Update RigData SET Platform='XXX', ProjectManager=YYY', ProjectEngineer='ZZZ' WHERE ID='13';"
However, when I do I get the following error:
"Data type mismatch in criteria expression"
I think this error is due to the ID fields being an AutoNumber type because if I change the SQL statement as follows it runs without error:
Chevon is a value in the Client column. The problem is that there are several records with Client= "Chevron" and I only want to update the one wit the ID value = 13
'modMain.UpdateAccess "Update RigData SET Platform='XXX', ProjectManager='YYY', ProjectEngineer='ZZZ' WHERE Client='Chevron';"
Can someone please explain how to make this work or offer and alternate method? Thank you.