Quote:
Originally Posted by hjozinovic
hey Visa,
i'm not sure why you get the message 'You canceled the previous operation'.
Obviously it's because of DoCmd.CancelEvent command but, I tried it myself and I got no message.
Attached here is my Test base. In MainForm's before update property you will find the code similar to the code you were using.
If bValue is less than 30 I get the message I asked.
After that I get no messages, only the record is still in editing mode as it should be, not allowing to save it before it meets the criterion set before.
Please try this and let us know the result.
h.
Thanks H for ur reply, I tried ur script beforeupdate, its still not working, so I used validation rule what u suggested before, instead Ord_Rcvd_Dt < Ord_Comp_Dt AND Len(Ord_Comp_Dt)>0 , I just tweaked it to < Ord_Rcvd_Dt and is not null, it works very well.
Now I have another question if you can help I have this combo box ord status, open (default) & closed, if user changes to close it should check other combo box status should be yes and one field should not be null,
Following is scenario user changes ord status = closed
combo box InOrdDoc = Yes and
InOrdDoc2 = Yes and field Product cannot be null,
I entered in Validation rule of Ord Status combo box
ord status = closed and InOrdDoc = Yes and InOrdDoc2 = Yes And Product is Not Null
Validation text: InOrdDoc and InOrdDoc2 must be yes and Product cannot be null.
I am trying to change Ord Status to Closed it fires continously,even I select open and my cursor sticks there and don't come out of my Order status field. So what event I should try or how to write in Validation rule.
Thanks in advance
-visa