Multiple buttons in one form

Sweets

New member
Local time
Today, 14:33
Joined
Dec 17, 2007
Messages
6
Is it possible to have multiple buttons in a form with which I can open different reports or forms in the same database?
If yes, what do I have to do? I am a beginner in Access. :o
 
Yes. You could use the built in switchboard wizard, or create your own form and use the button wizard to create your buttons.
 
Yes it is. If you have the control wizard on in Access, when you go to create a button the wizard will give you different options for opening reports and forms. It's quite easy so don't worry.

If you want to learn more about the coding behind them, you can create the button then press F7 on the design view of the form to view the code. Whatever the button is called (probably commandXX), you can find the code for it - it should say something like:

Private Sub commandXX_Click()
and end with
End Sub

If you need more help, post back
 
Since I am a beginner, can you explain this a bit more?
What I have: I have a form based on a query with about 6000 entries.
What I want is, have a button in some rows that lead to different forms or reports.
I have to add the buttons in design view, right? That's why I get one button for each row of the same column. Or can I add buttons in form view???
 
You need to add buttons in design view, you can't do it in form view.

If you are wanting a button to open a form, you need to create a button (keep the control wizard on for this) and follow the instructions it gives you. The first bit you need to choose Form Operations and then Open Form. From this, just follow what it says. It will give you the list of forms that it can open too on this menu.

This way, you dont need to look at a load of code too :)

If you want to create a button for opening a report, follow the same steps for creating a button to open a form, but this time, choose Record Operations and Preview Report.

It's that simple :)
 
Ok it doesn't work the way I want it.

Jojo86, I have done that a couple times and I get buttons (in all rows of one column) with the same link to the same form I want to open when I change to form view. But that's not what I want. All right, maybe I need to explain what I see when I open the form in design view. I only see the header and the footer and one row called Detail, but I don't see any of my 6000 entries. Because I've created the form with the form wizard and the source is a query. So how am I supposed to add a button to an entry I want to if I don't see it?!
And again if I do it thw way jojo86 suggested I get a whole column with the same button to the same form. And if I want to change, for example, the link of the sceond row, and I change to formview and click on the button, it will open two forms (the one from the first and the one from the second row).

Sorry, but I don't get it.
 
Last edited:
Try creating a brand new form.
In design view, drag and drop your query from the navigation menu (on the left of the screen) on to the Detail section of your form. This will use it as a sub form.
Resize your query, but don't make it the same size as the Detail section, leave a border.
Put your buttons in this border. You should only get one of each button.

Hope that helps.
 
Can you explain what you are trying to do? I don't understand either what you want or what is going wrong so it's very difficult to advise.
 

Users who are viewing this thread

Back
Top Bottom