Using Same Form For Different set of Records

  • Thread starter Thread starter Richard Meir via AccessMonster.com
  • Start date Start date
R

Richard Meir via AccessMonster.com

I have one form that I would like to use for all records. When I click on
the “preview categoryA button” I want the form to populate with categoryA
records. When I click on the “preview category B button”, I want the same
form to clear and populate with categoryB records.

Does anyone have code to do this in the After Click procedure??

Thanks,
Richard
 
Richard Meir via AccessMonster.com said:
I have one form that I would like to use for all records. When I click on
the “preview categoryA button” I want the form to populate with categoryA
records. When I click on the “preview category B button”, I want the same
form to clear and populate with categoryB records.

Does anyone have code to do this in the After Click procedure??

Presumably Category A and Category B records all reside in the same table and
have a single field [Category] that distinguishes them. If that is the case you
simply filter the form on the desired value of [Category]. So the Click event
of “preview categoryA button” would be...

Me.Filter = "[Category] = 'A'"
Me.FilterOn = True

The Click event for the other button should be obvious.

If the described situation is NOT what you have then the design is flawed and
should be corrected.
 
Ah yes. Excellent. This was the missing element.

Thank you!!

Richard
 
Back
Top