Command buttons, forms and queries question (HELP!)

alchemylab

New Member
Joined
Dec 8, 2003
Messages
1
Hi, I am using Microsoft Access 2002 for a database project and have a question regarding the use of command buttons on forms with queries on other forms.

I have multiple forms in the database. And on each of these forms there are multiple command buttons which relate to different information to be displayed. However whenever the user presses ANYONE of these command buttons on ANY of the forms, only one particular form is opened and this form is the SAME form for whatever command button was pressed. So I am reusing this same form over and over and over regardless of which command button was pressed anywhere in the database.

This new form contains a query as its "record source". I want know how I can make it so the "criteria" of this query on this form gets its value based upon which particular command button was pressed. All the different command buttons would have to provide a different value for the criteria of the query.

So in other words, when I press a particular command button, I want to pass a parameter or something over to the criteria of this query and this parameter will vary for each different command button resulting in different information being retrieved using the query. So anyone know if this sort of thing is possible? Do I have to use some VBA code? I have achieved this sort of thing with a combo box before, however I have to use command buttons this time round and have played around and am still unsure how to get it to work.

Anyway any help would be much MUCH appreciated! :rolleyes:
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,221,586
Messages
6,160,645
Members
451,661
Latest member
hamdan17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top