Look up a filter

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
 
G

Gerald Stanley

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
 

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