Condition testing Command Button

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.
 
S

Steve Schapel

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.
 
G

Guest

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.
 

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