Filtering Records on Form

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Marsh

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

Thanks
 
Back
Top