Message box icons, eg, critical X, info i, exclamation!

debbieb

New member
Local time
Today, 22:26
Joined
Feb 19, 2002
Messages
8
Hello, I would be grateful for any help

I have written message boxes in VB and have been able to add message box icons such as critical X, information i, exclamation!, etc However, I am really having problems recreating this in VBA in Access. I having been trying to following the help files but have not been successful. How can I add an information (i) mark to the following message box.

MsgBox ("Please enter a number between 1 and 3 or nothing")

Or is this not possible as I keep getting the error message "expected expression" when I add the following

MsgBox ("Please enter a number between 1 and 3 or nothing", vbInformation, , ,)

Any help would be much appreciated.
 
MsgBox "Blah Blah Blah", vbInformation

I only use the parentheses if I want to do something with the return value of the msgbox...

If msgbox("BlahBlahBlah", vbInformation+vbYesNo) = vbYes then
'Do something
Else
'Do something entirely different
endif

AND you need to eliminate the commas after you are done using the parameters (vbInformation, , , ). VBA will accept the parameters not provided as null and move on without them.
 
e.g.
Dim Msg, Style, Title, Response, MyString
Msg = "This customer currently has arrears of" & " " & Format(Abs(MyAmount), "£#,##0.00") & vbCrLf & " " & "Do you still wish to repay this deposit?"
Style = vbYesNo + vbExclamation + vbDefaultButton1
Title = "Repay Deposit verification"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
etc.
HTH
 
Scott and Rich

Many thanks for all your help - problem resolved thanks to your comments

Debbie
 

Users who are viewing this thread

Back
Top Bottom