How do I make the buttons in a MsgBox have custom text? Thanks!
You can't!
What you can do is create your own unbound form to be used as a
message form.
For example, add a Label control and a Text control as well as 2
command buttons.
You can caption them any way you want.
Name them cmdOK and cmdNo
You can set the font style, size, color, etc., however you wish.
Code the cmdOK button's click event:
TextControlName = 1
Me.Visible = False
Code the cmdNo click event:
TextControlName = 2
Me.Visible = False
You would then open the form, using:
Dim strMessage as String
strMessage = "This is your message. Click CommandOk for Yes or
CommandNo for No."
DoCmd.OpenForm "MessageFormName", , , , , acDialog, strMessage
If forms!MessageFormName!TextControlName = 1 then
' Do the Yes thing
Else
'Do the No thing
End If
DoCmd.Close acForm,"MessageFormName"
Code the Load event of the message box form:
LabelMessageName.Caption = Me.OpenArgs
When the form is opened processing waits (just like a MsgBox) until
you click either command button. Then the OK or No action will be
taken and the form closed.