Results 1 to 2 of 2

Thread: this should be quick and easy...

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    12

    Question this should be quick and easy...

    I'm actually programming in Access 97 but i'm sure there's some easy VB Code that will help me...

    I have a Msg Box pop up if the user tries to leave the record or close the form. It asks them if they need to go back and enter some information in a particular field. If they hit "Yes" i want Access to cancel the event they just activated (going to another record or closing the form). What can i do?

    TIA!!!!
    Ted

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Sub Command1_Click()
    2. If MsgBox("About to cancel this operation.  Any changes will *NOT* be saved. Are you sure?", vbYesNo, "Verify Cancel Changes") = vbNo Then
    3.    'do whatever you were about to do
    4. Else
    5.    'they clicked yes
    6.    Exit Sub
    7. End If
    8. 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
  •  



Click Here to Expand Forum to Full Width