Run-time error 2447 on MsgBox

G

Guest

I have a MsgBox coded as follows:

Dim intAnswer As Integer
intAnswer = MsgBox ("Would you also like to apply rules from the BizRules
Manager?", vbYesNoCancel + vbQuestion, "Apply BizRules")

Some (but not all) of my users receive the following run-time error message
when executing the MsgBox code above:
"There is an invalid use of the . (dot) or ! operator or invalid
parentheses.2447"

To a newbie like me it seems like Access is complaining about the
parentheses used in the MsgBox function but the compiler complains when I try
removing the parens (presumably because the function is assigning a value to
intAnswer).

Any help in avoiding the run-time error would be greatly appreciated!
 
B

Brendan Reynolds

I think you are mistaken in your belief that this particular line of code is
raising the error, Chris.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
G

Graeme Richardson

HI Chris, I agree with Brendan.

How do you conclude that this line of code is the cause of the error? The
error suggests that you have a mistake in a formula - possibly in one of
your controls.
 

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