Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OK Cancel MessageBox

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB
Hi

I have the following code generate a messagebox with ok/cancel buttons. I want to add an exclamation icon to the box. Where in the code do I put it. I keep getting the invalid procedure call method error or something like that. Can someone help please

Code:
Private Sub btnMainMenu_Click()
On Error GoTo Err_btnMainMenu_Click

    Dim stCloseFormName As String
    Dim stLinkCriteria As String
    stDocName = "frmMainMenu"
    stCloseFormName = "frmDDMain"
    
    If MsgBox("Would you like to return to the Main Menu", vbOKCancel, "Exit Warning") = vbOK Then
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    DoCmd.Close acForm, stCloseFormName, acSaveYes
    Else
    DoCmd.CancelEvent
    End If

Exit_btnMainMenu_Click:
    Exit Sub

Err_btnMainMenu_Click:
    MsgBox Err.Description
    Resume Exit_btnMainMenu_Click
    
End Sub
 
Put the cursor inside the MsgBox word in your code and then press the F1 key.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorted it. Add a "+" sign after the button type.

Thanks for your help. Nice quick reply too :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top