Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Message box options (2002)

    Hi,

    I have a message box that is activated if there are no records in a list when a form is opening. This works fine. I would like to give the user the option to either continue to open the form or cancel the action. How would I go about doing that?

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Message box options (2002)

    You can make a message box display various sets of buttons, for example a Yes and a No button, and you can make your application react to which button the user clicked. The second argument to the MsgBox function lets you specify which buttons are displayed, and which icon (if any) is displayed. You can look up a complete list of options by typing MsgBox in the Visual Basic Editor and pressing F1. Here is an example:

    If MsgBox("There are no records. Do you want to continue anyway?", _
    vbYesNo + vbQuestion) = vbYes Then
    ' Code to be executed if user clicks Yes goes here
    Else
    'Code to be executed if user clicks No goes here
    End If

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Message box options (2002)

    Thanks Hans. I tried looking it up but typed in message box and got very little. Didn't think to try msgbox!

    Leesha

Posting Permissions

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