Command Button on Form Doing 2 things

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
On a form i have a command button which i would like to print the current
record (for the current form) and print a secondary form that is linked to
the primary form. The secondary part is pretty easy. I call a macro which
opens the form, prints that record, and then closes that form. My issue
comes when trying to print both via a command button. I tried creating an
event procedure to print the current record and running that on "Mouse Down"
and then running my macro on "Mouse Up." However, i was unsuccessful in this
endeavor because it will only print my secondary form from the function.

Any Suggestions?

Thanks in Advance,
Rob
 
Rob said:
Hello,
On a form i have a command button which i would like to print the
current record (for the current form) and print a secondary form that
is linked to the primary form. The secondary part is pretty easy. I
call a macro which opens the form, prints that record, and then
closes that form. My issue comes when trying to print both via a
command button. I tried creating an event procedure to print the
current record and running that on "Mouse Down" and then running my
macro on "Mouse Up." However, i was unsuccessful in this endeavor
because it will only print my secondary form from the function.

Any Suggestions?

Thanks in Advance,
Rob

A single event can run any number of VBA code statements. You don't need to
use separate events.
 
Ok i am not very familiar with VB. What would be an example of a line of
code that i could use in the event procedure?

Thanks again,
Rob
 
Rob said:
Ok i am not very familiar with VB. What would be an example of a
line of code that i could use in the event procedure?

Take whatever code you would have in two separate buttons and just put all
of it in one event. Or you can do the same thing with one macro. A macro
is also capable of executing more than one action.
 
Back
Top