Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button on form that opens another form + displays only certain records

Status
Not open for further replies.

AccipiterQ

Programmer
May 25, 2005
27
US
Alright, so I've got a large contacts database containing a single table. One of the fields in the table is an event the contact participated in for the agency I work at(thanksgiving turkey drive, kid's fair, christmas telethon,etc.).

I have a master form for this table that displays all the fields in an asthetically pleasing manner.

Now here's what I want to do; I want to make another form that's basically like a switchboard. There's going to be buttons on this form, with the name of the different events on them (turkey drive, christmas telethon,etc.). When someone presses the buttons I want the master form to come up, and only display the records corresponding to the button they pushed. I.E. if someone hits the button on the switchboard form that says 'Turkey Drive' the master form comes up,and the only records displayed are those that have 'turkey drive' in the field for events participated in.

I tried just doing this straightforward by making a button on the switchboard which opens only certain records on another form but the wizard told me that that "I have chosen forms that can't be linked, you must have at least one field that can be linked in each form".

So how would I go about doing this? I get the sneaking suspicion I may have to use subforms, but I'd rather not, I want to keep the format I have now.
 
Hi
Have you tried something like the wizards offer?
[tt]DoCmd.OpenForm "[FormName]", , , "[SomeField]='Turkey Drive'"[/tt]
 
yup that worked....honestly this whole project has been a learning experience about how poweful VBA code is with MS Access...tahnks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top