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!
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!