Message Box

  • Thread starter Thread starter Bruce
  • Start date Start date
B

Bruce

I have tried various ways of getting a message box to pop
up when a user clicks a check box. The idea is to provide
some information associated with the choice. However,
when I attempt something in the On Click event such as:
MsgBox "Message", vbOKCancel, "Title"
I receive the following error message:
The expression On Click you entered as the event property
setting produced the following error: A problem occurred
while Microsoft Access was communicating with the OLE
server or ActiveX Control.
* The expression may not result in the name of a macro,
the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function,
event, or macro.
I have tried various suggestions from a Google groups
search, including checking the references at the tools
menu in the code window, and decompiling the database.
Nothing works. I also tried the same code at other
events, but all that changed was the error message.
Then I got the idea from a Google search to try opening a
form instead, using DoCmd. It seemed to me a good choice,
as I could use DoCmd to close the form on exit from the
control, eliminating the need to click OK or whatever:
DoCmd.OpenForm "frmInfo". Alas, same error message.
Anybody know what I'm doing wrong? Access Help, by the
way, offers nothing.
 
Imported objects into new database, and error message went
away. Now, how do I get the message box to go away when I
tab out of the field? Alternatively, opening the form as
I mentioned sort of works, but if I clear the check box I
get "runtime error 2501" an error message "Open Form
Action cancelled". This message pops up at other odd
moments too, especially it seems when I try to change my
mind about the checkbox.
 
Creating a help file so that when the control has the focus the user presses
F1 and sees the appropriate text seems to be the "professional" way to go
about this.
I think you have to have the developers edition to make help files.
I once played with making Labels containing the info and then using the
mouseover event to make the label visible and not visible. That quickly
turned into a WHOLE LOT OF WORK and the end result for a form with 30 or so
controls was not very satisfactory. It seemed that everywhere my mouse went
I had labels becoming visible. Very irritating.
You could try using the "tool tips" depending on the length of the info. I
tried this but I couldn't figure out how to give the user the option to turn
off tool tips once they had all the info they needed. Very irritating.
It will be interesting to see how others approach this challenge.

Mike
 
Thanks for the reply. On further consideration I have
decided against using message boxes as I originally
thought, but I still might need to do it sometime. I
solved the problem of error messages by importing the
objects into a new, blank database, so I think I am OK
with the message box idea, if I need to use it.
-----Original Message-----
Creating a help file so that when the control has the focus the user presses
F1 and sees the appropriate text seems to be the "professional" way to go
about this.
I think you have to have the developers edition to make help files.
I once played with making Labels containing the info and then using the
mouseover event to make the label visible and not visible. That quickly
turned into a WHOLE LOT OF WORK and the end result for a form with 30 or so
controls was not very satisfactory. It seemed that everywhere my mouse went
I had labels becoming visible. Very irritating.
You could try using the "tool tips" depending on the length of the info. I
tried this but I couldn't figure out how to give the user the option to turn
off tool tips once they had all the info they needed. Very irritating.
It will be interesting to see how others approach this challenge.

Mike
I have tried various ways of getting a message box to pop
up when a user clicks a check box. The idea is to provide
some information associated with the choice. However,
when I attempt something in the On Click event such as:
MsgBox "Message", vbOKCancel, "Title"
I receive the following error message:
The expression On Click you entered as the event property
setting produced the following error: A problem occurred
while Microsoft Access was communicating with the OLE
server or ActiveX Control.
* The expression may not result in the name of a macro,
the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function,
event, or macro.
I have tried various suggestions from a Google groups
search, including checking the references at the tools
menu in the code window, and decompiling the database.
Nothing works. I also tried the same code at other
events, but all that changed was the error message.
Then I got the idea from a Google search to try opening a
form instead, using DoCmd. It seemed to me a good choice,
as I could use DoCmd to close the form on exit from the
control, eliminating the need to click OK or whatever:
DoCmd.OpenForm "frmInfo". Alas, same error message.
Anybody know what I'm doing wrong? Access Help, by the
way, offers nothing.


.
 
Back
Top