how to add functions to a bottom?

ariansman

Registered User.
Local time
Today, 08:25
Joined
Apr 3, 2012
Messages
157
[FONT=&quot]There is a bottom on a form that has an action for example to print or to run a query. How can I add a close function, so that the window is also closed when it is clicked?
thank you
[/FONT]
 
In the design view of the Form, with the Design Tab showing, make sure Use Control Wizards is highlighted.
Then click the Button control and click where you want it on your form. The wizard will start.
Select Form Operations on the left and Close Form on the right.
Then next, next to the end.
Simples.
 
In the design view of the Form, with the Design Tab showing, make sure Use Control Wizards is highlighted.
Then click the Button control and click where you want it on your form. The wizard will start.
Select Form Operations on the left and Close Form on the right.
Then next, next to the end.
Simples.

yes it is very simple, but i could not find a way to run multiple functions on one single [FONT=&quot]button. This is not provided by the wizard. [/FONT]
 
cancel out of the wizard... right click on the button, build event, code builder and welcome to vba!~)
 
You can add another command to the macro assigned to your existing button:

Right click on the button, click Build Event goes to the macro designer.
In an empty row after any existing rows select the Close command with default settings.

But I'm sure everyone here including myself would encourage you to start learning VBA and simple commands like this are a good place to start. It's infinitely better than macros.
 
You can add another command to the macro assigned to your existing button:

Right click on the button, click Build Event goes to the macro designer.
In an empty row after any existing rows select the Close command with default settings.

But I'm sure everyone here including myself would encourage you to start learning VBA and simple commands like this are a good place to start. It's infinitely better than macros.

a new question,
I have inserted a button on the form to save the form data on a table. I did this through the “command button wizard”. I would like to know if there is an equivalent VBA code which acts the same, ie. Saves the data and goes to the next record, just like what is done in the macro.
 
Assuming that this is a Bound Form, as it really should be, for entering Records in in Access, the Record is automatically Saved when you either Move to another Record, Close the Form or Close Access itself. So you simply need to Move to the next Record, which can be done with

DoCmd.GoToRecord , , acNext

To Move to a New Record it would be

DoCmd.GoToRecord , , acNewRec

Linq ;0)>
 
Last edited:

Users who are viewing this thread

Back
Top Bottom