Combo Box For Searching Forms Help (1 Viewer)

Tomhoneyman

New member
Local time
Today, 06:09
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:09
Joined
May 7, 2009
Messages
19,246
myCustomer = "select from frmSearch where [Customer Name] = " & Chr(34) & me.cboSearchCustomer & Chr(34)
 

jdraw

Super Moderator
Staff member
Local time
Today, 01:09
Joined
Jan 23, 2006
Messages
15,393
In a SELECT, you have to identify something(s) to be Selected.

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

Users who are viewing this thread

Top Bottom