You can't format the text within a MSGBOX function, but i will show you
something else, that use the MSGBOX function.
There are 2 function AccessMsgBox and Enquote.(The last one is used within
the first one)
'This calls the Access message box instead of to the VBA one.
'The Access input box supports Windows XP theming and bold
' message strings by using the following notation:
' Example : AccessMsgBox "Text that will be bold. @Next line. @"
Function AccessMsgBox(Prompt As String, Optional Buttons As VbMsgBoxStyle =
vbOKOnly, Optional Title As String, Optional HelpFile As String = "",
Optional Context As Long = 0, Optional AcApp As Access.Application) As
VbMsgBoxResult
If AcApp Is Nothing Then Set AcApp = Application
' Build the MsgBox expression
Dim strExpr As String
strExpr = "MsgBox(" & Enquote(Prompt) & _
", " & Buttons & _
IIf(Title = "", "", ", " & Enquote(CStr(Title)) & _
IIf(HelpFile = "", "", ", " & Enquote(HelpFile) & ",
" & Context)) & _
")"
' Evaluate it
AccessMsgBox = AcApp.Eval(strExpr)
End Function
Here is the Enquote function:
Function Enquote(strText As String) As String
Enquote = """" & Replace(strText, """", """""") & """"
End Function
Have fun
