Filtering Records on Form

G

Guest

I have a list box on my form whose source is an organizational table with an
OrganizationID. The main source of the form is a table of individuals whose
records also have an OrganizationID. When I click a record in the list box,
I have code that transfers the ID from that organization record to a text
control on the form. At the same time I would like to filter all the
individual records down to only records with the selected OrganizationID.
Also I would like the user to then be able to easily drop the filter when
needed so that all records then re-appear.

I'm not sure how to do this. Any help would be appreciated.

Thanks

Frank Wagner
 
M

Marshall Barton

Frank said:
I have a list box on my form whose source is an organizational table with an
OrganizationID. The main source of the form is a table of individuals whose
records also have an OrganizationID. When I click a record in the list box,
I have code that transfers the ID from that organization record to a text
control on the form. At the same time I would like to filter all the
individual records down to only records with the selected OrganizationID.
Also I would like the user to then be able to easily drop the filter when
needed so that all records then re-appear.


You can construct a filter string and set the form's Filter
property when you set the text box:

Me.Filter = "OrganizationID = " & Me.listboxname
Me.FilterOn = True

You can use the Click event of a button on the form to turn
the filter off:

Me.FilterOn = False
 
G

Guest

Marsh

Sounds right on target. if I have any questions after trying it out, I'll
post a further response.

Thanks
 

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