If the OnLoad event is for the frmTracer form, then you can reference your control using the
Me.[Return Date] syntax. I would strongly suggest removing the space in the name as it is much safer to not have it and having it can lead to problems.
I'm not exactly sure the logic that you are wanting in the IF statement, but the basic syntax for an IF statement is
- If condition Then
-
'Do something here if the condition returns true
-
Else
-
'Do something else here if the condition returns false
-
End if
I think that you are wanting to check if
Return Date is older than today's date, having a message box open if that is the case. If this is correct, then your condition would be
- If Me.[Return Date] < Date Then
And you would put your code for the message box in the True side of the IF Statement.