Condition testing Command Button

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

Guest

I have a form with multiple test boxes to create a new record when a command
button is pushed. All works and closes the form.
I want a second command button to call the same maco and have a condition on
the form close action so as to not close if I want to add additional records.
How do I format the condition to test if the command button was pushed?

An alternative will be to have three macros and another textbox on the form.
The add more CMD call macro1 - set ADDMORE text box and call macro3 to add
records and text ADDMORE text box whether to close form. Macro2 would not
set ADDMORE text box and call macro3.
 
Karl,

You can use a Condition like the following, to test which button is pushed:
[Screen].[ActiveControl].[Name]="More"
.... in the case of the 2nd command button named More.
 
Thanks.
--
KARL DEWEY
Build a little - Test a little


Steve Schapel said:
Karl,

You can use a Condition like the following, to test which button is pushed:
[Screen].[ActiveControl].[Name]="More"
.... in the case of the 2nd command button named More.

--
Steve Schapel, Microsoft Access MVP

KARL said:
I have a form with multiple test boxes to create a new record when a command
button is pushed. All works and closes the form.
I want a second command button to call the same maco and have a condition on
the form close action so as to not close if I want to add additional records.
How do I format the condition to test if the command button was pushed?

An alternative will be to have three macros and another textbox on the form.
The add more CMD call macro1 - set ADDMORE text box and call macro3 to add
records and text ADDMORE text box whether to close form. Macro2 would not
set ADDMORE text box and call macro3.
 
Back
Top