Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    10

    Unanswered: Check Box to bring up message

    I m trying to have a check box bring up a message box when the accompanied text box is empty. Both the chack and text box are on the same form. I wrote a similar one that has the chack box on one form and the text box on a sub form. That one works great but this bugger is getting the best of me.

    I know it's probably something really simple. Here is what I have so far;

    Private Sub Termed_AfterUpdate()

    If (IsNull(Me![Termed Date])) Then
    err_msg = MsgBox("Please Enter Termed Date", vbOKOnly, "Date Error")
    End If
    End Sub

    Thanks for any help.

  2. #2
    Join Date
    Jul 2004
    Posts
    125
    AfterUpdate is irrelevant if you haven't updated anything. Use the LostFocus event of the control to send a message and force the user to stay in the control until they enter a date.

  3. #3
    Join Date
    Aug 2004
    Posts
    10
    I'm not to sure on how to use the Lost Focus but I will look into it. I was able to resolve the problem. It looks like it was just my coding

    Private Sub Termed_Click()

    If Me!Termed.Value = True And (IsNull(Me![Termed Date])) Then
    err_msg = MsgBox("Please Enter Termed Date", vbOKOnly, "Date Error")
    Me![Termed Date].SetFocus
    Else
    End If
    End Sub

    I did change it up a bit (always trying to improve thigs)

    Thanks for the reply and Maybe a new idea or 2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •