Message Box function

V

VHR

I am trying to use the message box function for the first time. I
would like a message box to appear when a user tries to update data in
a specific field. This message box says "Do you want to update this
field." If the user says NO, then I would like the field to remain
un-updated.

I have made a macro called "Verify Update." I have selected 'before
update'in the properties for this text box. In the macro, I've
assigned the yes,no options, following an example in an Access manual.

However, it's not working. The proper message box pops up, but if the
user says NO, it still updates the data...any idea what I'm doing
wrong?
Thanks!
 
R

Rick Brandt

VHR said:
I am trying to use the message box function for the first time. I
would like a message box to appear when a user tries to update data in
a specific field. This message box says "Do you want to update this
field." If the user says NO, then I would like the field to remain
un-updated.

I have made a macro called "Verify Update." I have selected 'before
update'in the properties for this text box. In the macro, I've
assigned the yes,no options, following an example in an Access manual.

However, it's not working. The proper message box pops up, but if the
user says NO, it still updates the data...any idea what I'm doing
wrong?
Thanks!

Are you setting the cancel argument of the event to True? That is what prevents the
update from occurring.
 
V

VHR

In the macro, the action I have chosen is CancelEvent, so I guess the
answer would be yes. What would be the correct action to choose?
Thanks
 
R

Rick Brandt

VHR said:
In the macro, the action I have chosen is CancelEvent, so I guess the
answer would be yes. What would be the correct action to choose?
Thanks

Sorry, I don't use Macros so I can't say. In VBA code it would be a line that
read...

If MsgBox("some text") = vbNo Then Cancel = True

or simply...

Cancel = (MsgBox("Some Text") = vbNo)
 

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