G
Guest
Have to do field validations in before update event. Not working though same
are working in other forms which are based on tables
and not on query. Following are codes which run on form based on table
(ofcourse with relevant field names) but not in query.These codes are being
assigned in Form based on queries.
Basically there r two tables : Flight Trans and Cancellation Flight Trans
Query links both on SubTransNo and Form is based on Query
Would request yrs expert opinion on same. Is there problem in referencing
Trans No in Query as
there are 2 of them one for invoice and other for credit note..Thanks
Dim aCnclDate As Variant
aCnclDate = DLookup("[Flight Trans]![FltTransDate]", "Flight Trans",
"[Flight Trans]![SubTransNo]" = "Me![Cncl Flight Trans.SubTransNo]")
If aCnclDate > Me![FltCnclTransDate] Then
MsgBox "Cncl Date cant be less than Invoice Date", vbOKOnly
Cancel = True
End If
End Sub
are working in other forms which are based on tables
and not on query. Following are codes which run on form based on table
(ofcourse with relevant field names) but not in query.These codes are being
assigned in Form based on queries.
Basically there r two tables : Flight Trans and Cancellation Flight Trans
Query links both on SubTransNo and Form is based on Query
Would request yrs expert opinion on same. Is there problem in referencing
Trans No in Query as
there are 2 of them one for invoice and other for credit note..Thanks
Dim aCnclDate As Variant
aCnclDate = DLookup("[Flight Trans]![FltTransDate]", "Flight Trans",
"[Flight Trans]![SubTransNo]" = "Me![Cncl Flight Trans.SubTransNo]")
If aCnclDate > Me![FltCnclTransDate] Then
MsgBox "Cncl Date cant be less than Invoice Date", vbOKOnly
Cancel = True
End If
End Sub