Eric58132
12-17-2010, 12:33 PM
Hi All,
I originally posted a question about this in this thread:
http://www.vbaexpress.com/forum/showthread.php?t=35008
which I later closed out because I thought everything was good. Well, a problem has risen...
I was able to get my code to work as long as I'm searching within text fields, but when it is a number field I'm searching on, I am asked to enter a parameter. A portion of my code looks as follows:
Dim SearchVariable As String
SearchVariable = Me.SearchCriteria.Value
If SearchVariable = "Street Name" Then
Me.Filter = "[Street Name] Like '*" & Me.Searchbox & "*'"
Me.FilterOn = True
ElseIf SearchVariable = "Job Number" Then
Me.Filter = "[Job Number] Like '*" & Me.Searchbox & "*'"
Me.FilterOn = True
In this instance, the "Street Name" option works, but the "Job Number" one does not.
Any ideas?
Thank you!
I originally posted a question about this in this thread:
http://www.vbaexpress.com/forum/showthread.php?t=35008
which I later closed out because I thought everything was good. Well, a problem has risen...
I was able to get my code to work as long as I'm searching within text fields, but when it is a number field I'm searching on, I am asked to enter a parameter. A portion of my code looks as follows:
Dim SearchVariable As String
SearchVariable = Me.SearchCriteria.Value
If SearchVariable = "Street Name" Then
Me.Filter = "[Street Name] Like '*" & Me.Searchbox & "*'"
Me.FilterOn = True
ElseIf SearchVariable = "Job Number" Then
Me.Filter = "[Job Number] Like '*" & Me.Searchbox & "*'"
Me.FilterOn = True
In this instance, the "Street Name" option works, but the "Job Number" one does not.
Any ideas?
Thank you!