Expression that restricts form to close...

  • Thread starter Thread starter Peter
  • Start date Start date
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!
 
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
 
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
 
Back
Top