Expression that restricts form to close...

P

Peter

Hi again,

How do I restrict the form to close (this is what happens after update) when
the below runs…i.o the result of this expression is further action..in this
case to choose other then “Bagâ€

If (Me.Bag = "Apples") And IIf (Me.Days = IsNull > 30) Then
Me.Days.SetFocus
MsgBox "Bla..bla bla "
End If

Thank you!
 
M

Marshall Barton

Peter said:
How do I restrict the form to close (this is what happens after update) when
the below runs…i.o the result of this expression is further action..in this
case to choose other then “Bag”

If (Me.Bag = "Apples") And IIf (Me.Days = IsNull > 30) Then
Me.Days.SetFocus
MsgBox "Bla..bla bla "
End If

Under what condition do you want the form to close? If it's
when the above If fails, then use:

Else
DoCmd.Close acForm, Me.Name, acSaveNo
just before the End If
 
P

Peter

Thanks you very much Marshall!

Marshall Barton said:
Under what condition do you want the form to close? If it's
when the above If fails, then use:

Else
DoCmd.Close acForm, Me.Name, acSaveNo
just before the End If
 

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