G
Guest
Trying to design a filter using vba. On a userForm I have a combobox w/ a
list of values I've typed in which correspond to certain fields in a table. I
also have a textbox into which the user can type an appropriate value. (e.g.,
one of the combobox's entries is Date Requested. When they select this item
from the box, I want the user to be able to enter a date into the textbox
(called searchVal), and press a command button to generate an SQL Select From
Where statement. I have the following code, which generates a run-time error
(3075 - missing operator) Any ideas where I'm going wrong w/ this syntax?
Thanks in advance.
Dim strSQL As String
strSQL = "Select * From Letters "
strSQL = strSQL & "Where (" & Me.Combo158.Column(0) & ") = """ &
Me.SearchVal & """;"
Me.RecordSource = strSQL
list of values I've typed in which correspond to certain fields in a table. I
also have a textbox into which the user can type an appropriate value. (e.g.,
one of the combobox's entries is Date Requested. When they select this item
from the box, I want the user to be able to enter a date into the textbox
(called searchVal), and press a command button to generate an SQL Select From
Where statement. I have the following code, which generates a run-time error
(3075 - missing operator) Any ideas where I'm going wrong w/ this syntax?
Thanks in advance.
Dim strSQL As String
strSQL = "Select * From Letters "
strSQL = strSQL & "Where (" & Me.Combo158.Column(0) & ") = """ &
Me.SearchVal & """;"
Me.RecordSource = strSQL