lpking2005
Board Regular
- Joined
- Mar 21, 2011
- Messages
- 140
Hi,
Not sure it his is meant to be on the Access message board or Excel.??
Im trying to use vba to find a recordset in an access database based on multiple criteria and then overwrite this record with data that is on an excel sheet.
At the moment i possibly have a problem with the SQL reference to the table.
When the code opens the connection it finds no record.
I think it may be failing because of too many 'And' clauses but im not sure of a way that i can use a 'WHERE' clause when trying to check a record based on multiple field data?
Any help would be appreciated.
Thank you!
Not sure it his is meant to be on the Access message board or Excel.??
Im trying to use vba to find a recordset in an access database based on multiple criteria and then overwrite this record with data that is on an excel sheet.
At the moment i possibly have a problem with the SQL reference to the table.
When the code opens the connection it finds no record.
Code:
strSQL = "SELECT * FROM Records WHERE [Current Date] = '" & curDate & "'" & " And [MFG Vessel] = '" & curVessel & "'" & " And [Batch Number] = '" & curBatch & "'"
I think it may be failing because of too many 'And' clauses but im not sure of a way that i can use a 'WHERE' clause when trying to check a record based on multiple field data?
Any help would be appreciated.
Thank you!