BUTTON in a FORM

Cedwards

New member
Local time
Today, 12:36
Joined
Dec 19, 2000
Messages
7
What I want is a button in a ready made form to open the queries which I have. And then I would like to be able to choose from the queries available.

Any Ideas!!!

Please Help. Thanx in advance
 
I would used a combo box rather than a button. You would have to set up a table with only one field containing the names of your queries.
Add your combo box using the wizard and select that table and field as the Row source.
Then on the After update event of the combo box, I would put the following code:

dim stQuery as string
stQuery = forms!YourFormName!YourComboBoxName
DoCmd.OpenQuery stQuery

When you select the query name in the combo box, the query will run.
 
Neal I don't understand visual Basic!! Any other suggestions?

Cheers
 
Im am new to Access also and dont really know any V.B. but what the guy above is telling you to enter the VB code. Try these things on a copy of your database in case it naffs up!

Go into design view, select the combo box you have made as explained by the other guy. Right Click, Choose Properties, Select 'Build Event' Choose 'Code Builder' your now in VB - Simply enter the Code which the guy has given you between 'BEFORE SUB' and 'END SUB', choose Save and your laughing!
 

Users who are viewing this thread

Back
Top Bottom