macro ordering confused?

G

Guest

I have a macro attached to an onclick property of a copy button (on a form)
that:
1) Displays a Msgbox if the condition on the 'current' field is current
[Forms]![Students]![current]="Current"
2) OpenForm if [Forms]![Students]![current]="Current"
3) Setvalue x15 rows(Copies 15+ attributes from one form to another form)

4) also displays another Msgbox if [Forms]![Students]![current]="Applicant"
Or "Archived is met.
5) StopMacro (last row) -

If a user tries to use the copy button to copy data on a form if the
[current] field is ="Applicant" Or "Archived , then the correct Msgbox opens
and doesnt copy any fields.this works fine.

The problem is at the moment, if the field [current] = "current" then it
does display the first/correct msgbox, BUT then displays the other msgbox
appears (which is only supposed to appear when the condition
[Forms]![Students]![current]="Applicant" Or "Archived is met). --> and THEN
it activates the Openform and SetValue action.

I was wondering how i could stop the 2nd msgbox from opening if the
"current" value is used, but at the same time keep the 2nd msg box working
(and not activating the setvalue actions) if the [current] field is
"archived" or "applicant"

Any help would be appreciated.
 
T

tina

sounds like your macro sequence should be as follows:

Condition: [Forms]![Students]![current]="Current"
Action: Msgbox
Condition: ...
Action: OpenForm
Condition: ...
Action: SetValue
(if you're using multiple SetValue actions at this point, include them in
this example.)
Condition: ...
Action: StopMacro
Condition: [Forms]![Students]![current]="Applicant" Or
[Forms]![Students]![current]="Archived"
(the above condition should be all on one line, of course)
Action: Msgbox
Condition: [blank]
Action: StopMacro

make sure you include the ellipsis (...) in the condition column as
indicated.

hth
 
T

tina

you're welcome :)


Connie said:
thanks tina. it works now

Connie said:
I have a macro attached to an onclick property of a copy button (on a form)
that:
1) Displays a Msgbox if the condition on the 'current' field is current
[Forms]![Students]![current]="Current"
2) OpenForm if [Forms]![Students]![current]="Current"
3) Setvalue x15 rows(Copies 15+ attributes from one form to another form)

4) also displays another Msgbox if [Forms]![Students]![current]="Applicant"
Or "Archived is met.
5) StopMacro (last row) -

If a user tries to use the copy button to copy data on a form if the
[current] field is ="Applicant" Or "Archived , then the correct Msgbox opens
and doesnt copy any fields.this works fine.

The problem is at the moment, if the field [current] = "current" then it
does display the first/correct msgbox, BUT then displays the other msgbox
appears (which is only supposed to appear when the condition
[Forms]![Students]![current]="Applicant" Or "Archived is met). --> and THEN
it activates the Openform and SetValue action.

I was wondering how i could stop the 2nd msgbox from opening if the
"current" value is used, but at the same time keep the 2nd msg box working
(and not activating the setvalue actions) if the [current] field is
"archived" or "applicant"

Any help would be appreciated.
 

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