My Form name is ORPInsForm. The field I am working with is called YRID. On exiting my field named VehicleID the event procedure occurs:
[tt]Private Sub VehicleID_Exit(Cancel As Integer)
YrID = Year(Date)
End Sub[/tt]
so the result is 2001
and that works.
However, I want to be able over-write the entry after the event procedure occurs to let's say 2002 and have it not be changed by running the event procedure again. I created this formula:
[tt]Private Sub VehicleID_Exit(Cancel As Integer)
If Forms!ORPInsForm!YrID!>1 Then YrID
else
Year(Date)
End Sub[/tt]
I am getting a compile error. What is wrong with this code?
Thanks, Bill
Bill@bMcAuley.com
[tt]Private Sub VehicleID_Exit(Cancel As Integer)
YrID = Year(Date)
End Sub[/tt]
so the result is 2001
and that works.
However, I want to be able over-write the entry after the event procedure occurs to let's say 2002 and have it not be changed by running the event procedure again. I created this formula:
[tt]Private Sub VehicleID_Exit(Cancel As Integer)
If Forms!ORPInsForm!YrID!>1 Then YrID
else
Year(Date)
End Sub[/tt]
I am getting a compile error. What is wrong with this code?
Thanks, Bill
Bill@bMcAuley.com