Look up a filter

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

i wish to let users type in a name to a text box, which
will then be the filter to apply to the table i have
linked to. I have taken this approach as i could not get a
drop down to only give me unique client names - instead
every occurence of the client naem in the table appears.

Otherwise i would be happy to have the form i have
produced, which has the client as the forst field, to be
used as the criteria for the filter.

This way i could produce a report from a command button
for all the units associated with that client.

Any help is appreciated

Regards

Richard
 
To have unique names appear in the list box, you need to
amend the RowSource SQL to include the word DISTINCT e.g.
SELECT DISTINCT clientNameColumn FROM ClientTable

Whether you use the textbox or listbox, to apply the filter
to the form, code the AfterUpdate eventhandler along the
following lines
DoCmd.ApplyFilter , "clientNameColumn = '" &
controlName.Value & "'"

Obviously, you will have to change clientNameColumn,
ClientTable and controlName to suit your application.

Hope Thsi Helps
Gerald Stanley MSCD
 
Back
Top