ssteel01
11-09-2000, 09:02 AM
Here's my dilemma. In a form, I need to set up a validation rule such that if the value entered into that field does not match the value in a previous field in that form, the user cannot procede and receives a "wrong barcode" message. (I figured out how to do the wrong barcode message, but the checking one field against another is killing me). Many thanks in advance!
Fornatian
11-09-2000, 09:49 AM
Try this in the on exit event of the second box:
If Me![ThisField] = Me![PreviousField] then
Msgbox("Whatever Error")
End if
I think it should work.
Ian
Pat Hartman
11-12-2000, 07:19 PM
To be absolutely correct you'll have to also place the code in the BeforeUpdate event of the form. If the user never places the cursor into the second field, its exit event will never be triggered and you could save the record with invlid data.