To use the example I supplied above:
[vba]
Public Function TestMyMessageBox()
Dim nResult As Integer
Set MyMsgBox = New cls_MessageBox
With MyMsgBox
'// you can have any combinations of buttons(up to 3!)
.Button1Text = "Print Report"
.Button2Text = "Quit"
'.Button3Text = "3rd Button" '// not used here
.BoxStyle = Information
.Prompt = "Testing my MyMsgBox"
.Title = "Title here"
End With
nResult = MyMsgBox.MessageBox '// Loads MessageBox
Select Case nResult
Case 1:
DoCmd.OpenForm "frm_Form1"
Case 2:
DoCmd.OpenForm "frm_Form2"
Case 3:
DoCmd.Close
End Select
End Function[/vba]




Reply With Quote