Dynamic Reports: Free Text Filtering

C

crtopher

I am following Martin Greene's tips descibed here:

http://www.fontstuff.com/access/acctut19.htm#dialog5

except adapting them to open and filter a query; i am building the dialog
box and have got as far as pasting the apply filter button code; when i hit
the apply filter button it says

microsoft visual basic compile error: sub or function not defined

when i click ok the SelectCase part of...

If IsNull(Me.txtlastname.Value) Then
strLastName = "Like '*'"
Else
SelectCase Me.FraLastname.Value
Case 1
strLastName = "Like '" & Me.txtlastname.Value & "*'"
Case 2
strLastName = "Like '*" & Me.txtlastname.Value & "*'"
Case 3
strLastName = "Like '*" & Me.txtlastname.Value & "'"
Case 4
strLastName = "= '" & Me.txtlastname.Value & "'"
End Select
End If

....is highlighted.

Why won't this work?
 
J

John Spencer

Perhaps you mean that there SHOULD be a space between Select and Case.



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================


There should not be a space between Select and Case.
 
J

John Spencer

Iamsogladthatiswhatyoumeant

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
C

crtopher

Thanks to both of you...it now works well

Chris

John Spencer said:
Iamsogladthatiswhatyoumeant

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top