I finally figured it out, thanks Steve
----- RobH wrote: ----
The condition needs to be a comparison of the data entered...for example "[new_data]<[other_data]", if this condition is true, the macro will run, otherwise no run. If the condition is true, RunCode....................... The problem is the record is saved regardless of what is selected in the dialog box (yes,no,OK,esc....). This macro is set to run before update of a form and is being used to validate data entered. If I can get it to work, I intend to validate several controls in the same macro. Is there a better way
Rob
----- Steve Schapel wrote: ----
Rob
If you are going to use RunCode in a macro, you will need to set u
the full code for the process you want, which includes specifying wha
you wanrt to happen for each of the message box responses. If you ar
going to do that, I guess I can't see any point in a RunCode macro..
you might as well just put the code on the event and scrap the macro
However, you can do this with a macro... In the macro Condition put..
MsgBox("Questionable entry, do you wish to save record?",4)=
.... and then in the action, simply CancelEvent. This macro goes o
the form's BeforeUpdate event, right? I think this will achieve wha
you want. The message box gives Yes and No buttons, if the answer i
Yes the record is saved, if it's No, the update is cancelled and th
user is returned to the form
- Steve Schapel, Microsoft Access MV
On Mon, 12 Jan 2004 21:36:11 -0800, "RobH