Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA to set form Filter Property in an ADP

Status
Not open for further replies.

amarkmac

IS-IT--Management
Aug 3, 2006
13
US
I have a simple form displaying a list of records. At the top of the form is a combo box in which the user can type a search string, then click a "find" button. The find button's click event contain code that sets the form's filter property:

Me.Filter = "(myFieldName Like '*" & Me.FindTxt.Value & "*')"
Me.FilterOn = TRUE

This form works great in an Access database (MDB), but when I port it over to a project version of the same application (ADP), it filters everything out. (The only change made to the form is modifying the syntax on RecordSource to reference the table as ADP instead of ODBC.) No errors are generated, it just returns no records. I didn't want to use the ServerFilter property because that would increase network traffic (I'd have to have the server process the filter then retransmit the dataset).

Does anyone know why the regular filter property wouldn't work the same in ADP?
 
Me.Filter = "myFieldName Like '[!]%[/!]" & Me!FindTxt.Value & "[!]%[/!]')"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the quick catch, PHV. That worked. I forgot about the different wildcard indicator in ADP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top