Results 1 to 3 of 3
  1. #1
    imintrouble is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Missouri, where frownin's a sport
    Posts
    127

    messagebox help :D

    Hello fellow access enthusisasts! I seem to be in the market for some help with creating a yes/no/cancel message box. I'll post the code i have so far below. Yes runs the code that is already there, saving the information and closing access, no is supposed to close without saving, and cancel cancels the action of closing access. P.S. this is in the unload portion of my form, so theres no way to close it without triggering this message box.




    Code:
     
    Dim strAnswer As String
    strAnswer = MsgBox("Are you sure you wish to exit? Doing so will log you out. Please click Yes to Log-out.", vbQuestion + vbYesNoCancel, "Confirm")
    If strAnswer = vbYes Then
      Me!End_Time = Format(Now(), "hh:nn:ss")
     DoCmd.Close acForm, "F_PartAdds"
        Cancel = True
    End Ifmes
    good luck >.<

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Hi imintrouble!

    What exactly is your question?

    What needs to happen when the user clicks 'No' . . . or 'Cancel'?

  3. #3
    imintrouble is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Missouri, where frownin's a sport
    Posts
    127
    Hey long time no type Robeen. my question is pretty simple this time.

    The No button needs to NOT save the information and close out,

    and the Cancel button needs to cancel the closing event from even happening.

    It was working fine before I tried to make it into a yesnocancel from just a yesno. But having that extra option helped with being able to escape a possible loop. and man was that annoying.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Make a messagebox
    By carstenhdk in forum Queries
    Replies: 7
    Last Post: 05-18-2010, 06:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums