Do not update record

R

Raul Sousa

I have this code in the before update event:

tadoc = Left(DocID, 6)
datemax = DMax("datef", "invoice", "DocID like """ & tadoc & "*""")
If DateF < datemax Then
MsgBox "BLa, bla, bla"
Do not update record
End If

My intention is to prevent new records to have a date before the last date.

Unfortunately I do not know to code the “do not update record†part.
I would be most grateful if someone tells me a way of doing this.
 
S

Stefan Hoffmann

hi Raul,

Raul said:
I have this code in the before update event:
My intention is to prevent new records to have a date before the last date.
Unfortunately I do not know to code the “do not update record†part.
I would be most grateful if someone tells me a way of doing this.
Use the Cancel parameter, set it to True.


mfG
--> stefan <--
 
M

missinglinq via AccessMonster.com

Try Me.Undo

Raul said:
I have this code in the before update event:

tadoc = Left(DocID, 6)
datemax = DMax("datef", "invoice", "DocID like """ & tadoc & "*""")
If DateF < datemax Then
MsgBox "BLa, bla, bla"
Do not update record
End If

My intention is to prevent new records to have a date before the last date.

Unfortunately I do not know to code the “do not update record†part.
I would be most grateful if someone tells me a way of doing this.
 
Top