Message Box function

  • Thread starter Thread starter VHR
  • Start date Start date
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!
 
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.
 
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
 
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)
 
Back
Top