call macro using command button

M

mike

Hi all,

How do you program a command button to call a macro. i
have a macro created and in a form. I have a command
button. With the command button, I need to call the macro.
Is this possible??

Thanks for the help...

mike
 
G

Gary Miller

In the OnClick Event Properties of your command button just
start typing the name of your macro and it should autofill
the rest of the name for you. That's all you need.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
M

mike

In addition to calling the macro, I also want the command
button to perform some action after the macro is stopped.
I have a command button in my form and the command button
calls the macro to resize the form and then it display
page 2 on the form. Is it possible to perform those steps??

Thanks for the help..

Mike
 
G

Gary Miller

Mike,

You can only call one macro at a time per event, however you
can have one macro do multiple actions. You could tell the
macro to do something else after the resize. I am not sure
what you mean about 'page 2' as forms don't really have
'pages' in that sense. Do you mean the second or next
record?

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
M

mike

there is a control in a form design windows. This control
is call Pagebreak. I don't know exactly what it does, but
i'm thinking this Pagebreak will create two sepearte page
in a form. I'm still testing what it does. Anyway, I'm
trying to use a macro to do more action when a command
button is click. Can a macro go to a control, lets say a
user text box, in the subform from the main form??

Thanks for the help...

mike
 
G

Gary Miller

To go to the control on the subform using a macro you need
to use the GoToControl Action two times. First go to the
subform control, then do it again with the name of the
control on the subform. Using VBA you would do it with one
'SetFocus' command.

The Pagebreak will force a new page when you print, but
isn't used that commonly as most folks rely on Reports for
printing and Forms for data entry/editing/viewing.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
M

mike

Thanks for your help.

mike
-----Original Message-----
To go to the control on the subform using a macro you need
to use the GoToControl Action two times. First go to the
subform control, then do it again with the name of the
control on the subform. Using VBA you would do it with one
'SetFocus' command.

The Pagebreak will force a new page when you print, but
isn't used that commonly as most folks rely on Reports for
printing and Forms for data entry/editing/viewing.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top