View Single Post
  #2  
Old April 29th, 2008, 04:31 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Adding a MsgBox when criteria are true

Since it's possible that they might not actually tab through the second
textbox, I'd recommend putting the logic in the form's BeforeUpdate Event:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If Me.Textbox1 0 And IsNull(Me.Textbox2) = True Then
MsgBox "You must provide a value for both Textbox1 and Textbox2"
Cancel = True
End If

End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Gabriella777_2" wrote in message
...
I have a a form that contains 2 text boxes that are not used every time the
form is used. However, if the first box is used the second must be used.
So
do I create a MsgBox to pop up based on an if then equation(?)?
The end result would be that when the user exits the second text box
(OnExit) it would look at the previous box and determine if the default
value
($0.00) was changed (always a 0 amount). If yes, and the exited text
box
is still empty, then put up a pop up to remind that it must be filled in.
Does that makes sense or is there an easier way?
--
Thanks and God bless you and yours,
Gabriella777_2