If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
pop up box
I just need a pop up box, like a message box, but instead
of just selecting ok I need to be an option box where you can select yes or no. It would be excellent if you could edit what the commands says instead of yes/no. I just plan on having this execute every time a form in closed. |
#2
|
|||
|
|||
pop up box
Dan,
Is there something you don't like about the MsgBox? Debug.Print MsgBox("blah blah", vbYesNo+vbQuestion, "MyDialog") Regards, Graham R Seach Microsoft Access MVP Sydney, Australia Microsoft Access 2003 VBA Programmer's Reference http://www.wiley.com/WileyCDA/WileyT...764559036.html "Dan" wrote in message ... I just need a pop up box, like a message box, but instead of just selecting ok I need to be an option box where you can select yes or no. It would be excellent if you could edit what the commands says instead of yes/no. I just plan on having this execute every time a form in closed. |
#3
|
|||
|
|||
pop up box
you can set the Msgbox() function to show multiple buttons: Yes/No,
Ok/Cancel, Retry/Cancel, and Yes/No/Cancel. if you want other button labels, i believe you'll have to build your own "pop-up" form to suit your needs. when you use a multi-button message box, you have to include additional coding to handle the user's "choice", of course. hth "Dan" wrote in message ... I just need a pop up box, like a message box, but instead of just selecting ok I need to be an option box where you can select yes or no. It would be excellent if you could edit what the commands says instead of yes/no. I just plan on having this execute every time a form in closed. |
#4
|
|||
|
|||
pop up box
That works great, just one question. How do you capture
what button is clicked? |
#5
|
|||
|
|||
pop up box
You could try something like this.
Dim strMessage As String strMessage = "Do you want to do something?" If MsgBox(strMessage, vbYesNo) = vbYes Then MsgBox "You clicked yes", vbOKOnly Else MsgBox "You clicked no", vbOKOnly End If Jim -----Original Message----- That works great, just one question. How do you capture what button is clicked? . |
#6
|
|||
|
|||
pop up box
Dan,
The return value depends on which buttons are displayed. If you specify vbOK, then that's what you test for, and if you specify vbCancel, then test for vbCancel. Even if you specify multiple buttons, for example, vbYesNoCancel, you can test for vbYes, vbNo and vbCancel individually. The following is a typical example: Dim iReturn As Integer iReturn = MsgBox("blah blah", vbAbortRetryIgnore + vbCritical, "my Custom MsgBox") Select Case iDigit Case vbAbort Case vbRetry Case vbCancel End Select You can also do it this way: Select Case MsgBox("blah blah", vbAbortRetryIgnore + vbCritical, "my Custom MsgBox") Case vbAbort Case vbRetry Case vbCancel End Select ....and this way... If vbYes = MsgBox("blah blah", vbYesNo, "my Custom MsgBox") Then Regards, Graham R Seach Microsoft Access MVP Sydney, Australia Microsoft Access 2003 VBA Programmer's Reference http://www.wiley.com/WileyCDA/WileyT...764559036.html "Dan" wrote in message ... That works great, just one question. How do you capture what button is clicked? |
Thread Tools | |
Display Modes | |
|
|