MsgBox..Expected End of Statement

D

Duck

This seems like it should be simple, but I can't figure out the
error. I have button on a form that print out a report if the client
whose record appears on the form has achieved a certain status (Phase
III). However I keep getting this error: Compile error: Expected End
of Statement

intAnswer = MsgBox [FirstName] & " " & [LastName] & " Is Not Phase
III...Print Itinary Anyway?", vbYesNo, "Not Phase III"
 
J

JulieS

Duck said:
This seems like it should be simple, but I can't figure out the
error. I have button on a form that print out a report if the
client
whose record appears on the form has achieved a certain status
(Phase
III). However I keep getting this error: Compile error: Expected
End
of Statement

intAnswer = MsgBox [FirstName] & " " & [LastName] & " Is Not Phase
III...Print Itinary Anyway?", vbYesNo, "Not Phase III"

I believe you are missing the open and close parentheses.
Try:

intAnswer = MsgBox ([FirstName] & " " & [LastName] & " Is Not Phase
III...Print Itinary Anyway?", vbYesNo, "Not Phase III")

I hope this helps.
Julie
 
B

boblarson

Duck:

Just so you know - if you have a function and you are assigning it to
something like:

intAnswer = MsgBox ([FirstName] & " " & [LastName] & " Is Not Phase
III...Print Itinary Anyway?", vbYesNo, "Not Phase III")

then you have to use the parentheses. If you are just DISPLAYING the
message box then you don't:

MsgBox [FirstName] & " " & [LastName] & " Is Not Phase
III...Print Itinary Anyway?", vbOK, "Not Phase III"

--
Bob Larson
Access World Forums Administrator

Tutorials at http://www.btabdevelopment.com

__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top