Results 1 to 5 of 5
  1. #1
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167

    msgbox with 3 options

    Hello everybody and Happy New Year,




    I would like to have your help on a seemingly simple question. I have a form in which is embedded a cmdButton. I want "on-click" to gives a simple message (eg. "abcd") with 3 options: a) On-Cancel to close the base, b) On-Open A" to open the form A, and c) On-Open B" to open the form B.


    I Would appreciate any help.


    Happy New Year 2014 again and thanks in advance


    Sincerely,


    George

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Msgbox does not support custom captions for buttons. See http://msdn.microsoft.com/en-us/libr.../gg251821.aspx
    You may use an input box instead listing out the three choices and asking user to enter a,b or c based on their choice.

  3. #3
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167
    Hello my friend "amrut",

    Because I'm not experienced in vba could you please give me an example so that I can figure how can i do it;

    Thanks again,

    Regards,

    George

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Search for Inputbox in help.
    Here is one example
    Code:
    Private Sub Command1_Click()
    Dim yourChoice As String
    yourChoice = InputBox("Enter your choice " & vbNewLine & "a for Choice one" & vbNewLine & "b for Choice two" & vbNewLine & "c for Choice three", "Select option")
    Select Case yourChoice
    Case "a"
    MsgBox "User selected a"
    Case "b"
    MsgBox "User selected b"
    Case "c"
    MsgBox "User selected c"
    Case Else
    MsgBox "Invalid choice"
    End Select
    
    End Sub

  5. #5
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167
    Hi again,

    thank you very much for your help my friend. I would try the code and i will be back.

    thanks again

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

Similar Threads

  1. VBA code for MsgBox
    By mladen273 in forum Programming
    Replies: 8
    Last Post: 01-17-2013, 10:05 PM
  2. Yes No msgbox
    By imintrouble in forum Access
    Replies: 3
    Last Post: 10-14-2011, 02:24 PM
  3. MsgBox
    By Mtyetti in forum Forms
    Replies: 4
    Last Post: 07-27-2011, 01:51 PM
  4. MsgBox Placement
    By tpcervelo in forum Programming
    Replies: 2
    Last Post: 12-27-2010, 07:36 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