Hi guys,
I was hoping you could help me with a problem. I'm trying to search for a particular string that the user inputs against all records in a table and then use the first search result to return data in another field in the same record.
I'm trying to use sql to do the search but I don't know how to hold the records that match the search criteria and return information from a separate field.
Code:
DoCmd.RunSQL "SELECT PatientInsurance.[Patient ID] FROM PatientInsurance WHERE [Contact] LIKE '" & strSearch & "';"
Where PatientInsurance is a table and the contact is a field within that table. I want to return the field [Patient ID] from the first record found in that sql query. How would I go about storing that data in a variable?
EDIT: Changed the sql statement.