Hello,
How can I create a recordset that will search every table in my database for a specific value?
Not all the tables contain the field [Customer].
E.g.
Dim sSQL As String
sSQL = "SELECT *.[Customer], *.[User] FROM * " & _
"WHERE (*.[Customer] = "John" "
Dim Rs As Recordset
Set Rs = CurrentDb.OpenRecordset(sSQL)
If Rs.RecordCount > 0 Then
DoCmd.OpenForm...
If the value exists in another table I want to open a form and display the matching records. Once this code works, I should be able to fill a listbox with the matching records, using the same SQL code, in the forms' Load procedure.
Please let me know of a good way to do this,
Thank you,
Blair
How can I create a recordset that will search every table in my database for a specific value?
Not all the tables contain the field [Customer].
E.g.
Dim sSQL As String
sSQL = "SELECT *.[Customer], *.[User] FROM * " & _
"WHERE (*.[Customer] = "John" "
Dim Rs As Recordset
Set Rs = CurrentDb.OpenRecordset(sSQL)
If Rs.RecordCount > 0 Then
DoCmd.OpenForm...
If the value exists in another table I want to open a form and display the matching records. Once this code works, I should be able to fill a listbox with the matching records, using the same SQL code, in the forms' Load procedure.
Please let me know of a good way to do this,
Thank you,
Blair