Combo Box For Searching Forms Help

Tomhoneyman

New member
Local time
Today, 14:46
Joined
Feb 16, 2016
Messages
3
Okay, I am making a database and want to use a combo box to search a form and display date in a subform to give multiple search criteria.
I have followed a YouTube step but cant get it to work. The code is as below, anything jump out at you?


Private Sub cboSearchCustomer_AfterUpdate()
Dim myCustomer As String
myCustomer = "select from frmSearch where (Customer Name) = me.cboSearchCustomer "
Me.frmTest2SubForm.Form.RecordSource = myCustomer
Me.frmTest2SubForm.Form.Requery
End Sub

I am getting error message:

Runtime Error 3141
The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.

Tom
 
myCustomer = "select from frmSearch where [Customer Name] = " & Chr(34) & me.cboSearchCustomer & Chr(34)
 
In a SELECT, you have to identify something(s) to be Selected.

Select field1, field2 from someTable......
 

Users who are viewing this thread

Back
Top Bottom