run different query for form

T

tim

I have 2 forms (A & B). Form A has two buttons (button x & button y).
Form B gets its data from a query which apart from name and age lists the
company that person works for.
Now I would like for when I press button x the form (Form B) loads up
but shows only people who work for company A.
I want button y to do a similar thing but only show people from company B.
So I want to use one form to show different data depending upon which button
i pressed on another form. Anyone help please..
 
A

Al Camp

Tim,
If I understand correctly...
You could use the Where argument in your OpenForm for A and B.
DoCmd.OpenForm "frmFormB" , , , "Company = 'CompanyA'"
 
T

tim

Cheers Al,

I was too busy looking for a hard solution to what i thought was a hard
problem, that i didn't see the easy solution.
 
Top