Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012
    Posts
    126

    Unanswered: Need help with a VBA msg box

    I have on the close event this code

    DoCmd.GoToRecord , , acNext
    my form is simply a form for the user to enter the date they are going to be working with. I then append that date to a another and drive the rest of my reports off that date. The reason im using the gotorecord , , acnext is without telling access "im done with this record move to the next" it doesn't record the date. The issue im having is if the user decided to open the database and then just close access without entering the date they get the debug screen. I'd like for a msgbox to open saying No Date Entered and once they hit okay it goes back to my form and if they hit cancel it closes the DB. Any help would be greatly appreciated.

  2. #2
    Join Date
    Aug 2012
    Posts
    126
    I am probably over thinking this but heres what i came up with and its not working ;/

    On Error GoTo Err_From_close

    'go to next record
    DoCmd.GoToRecord , , acNext

    Exit_Form_Close:
    Exit Sub
    Err_Form_Close:
    If MsgBox("No Date Entered!", vbRetryCancel, "No Date Entered!") = vbCancel Then
    DoCmd.Quit
    Else
    End If
    Resume Exit_Form_Close:

    Exit Sub

    End Sub

Posting Permissions

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