Results 1 to 4 of 4
  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

    Yes No msgbox

    Hello! I have a message box in the unload portion of my ONE form. When the user clicks yes, it will run some code and then close. When they click no or cancel, i don't care which, it simply returns the user to the form without closing the database down.

    like if a person tries to close out of access, because the form is to always be up hence the need for a message box asking if they really want to close it, the message box pops up. "Click YES if you want to log-out. Click No/Cancel if you are not yet ready to log-out."



    yes runs code and closes as normal, no/cancel returns the user to the form without closing access. it sounds simple, but thats just me.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    What is your issue?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  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
    I don't know how to make this kind of message box that has just a yes and a no and which also, when no is clicked, keeps access open with the database still open as well. If yes is selected i wish for it to simply close as normal.

    basically this is an, Are you sure you want to close? yes to close, no to not close.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    MsgBox has two forms: a function and a simple popup. The function is structured with parens and must be part of an expression. See http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx

    Example:
    intResponse = MsgBox("Do you want to quit?", vbQuestion + vbYesNo)

    This is also possible:
    If MsgBox("Do you want to quit?", vbQuestion + vbYesNo) = vbYes Then
    'do something
    End If

    Simple popup:
    MsgBox "Procedure completed successfully"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Suppressing a msgbox
    By alphabetsoup in forum Forms
    Replies: 3
    Last Post: 10-04-2011, 10:30 AM
  2. MsgBox
    By Mtyetti in forum Forms
    Replies: 4
    Last Post: 07-27-2011, 01:51 PM
  3. Msgbox with data in
    By AndycompanyZ in forum Programming
    Replies: 9
    Last Post: 06-27-2011, 07:52 AM
  4. Custom MsgBox
    By roccoIT in forum Programming
    Replies: 3
    Last Post: 07-06-2010, 10:43 AM
  5. Yes No Cancel MsgBox
    By Rick West in forum Forms
    Replies: 5
    Last Post: 04-14-2010, 08:57 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