I need a little help trying to find the correct event, as well as the correct vba to change the value of a check box.
I have two tables:
There is a date field in each:
There is a checkbox in tbl2 - [tbl2].[cb2].
If [tbl2].[endDt] is greater than [tbl1].[stDt] then the value of the check box in tbl2 should change from False to True.
I tried the following:
Private Sub Form_Current()
Me.[tbl2].[cb2] = False
If [tbl2].[endDt] > [tbl1].[stDt] Then
Me.[tbl2].[cb2] = True
But the issue I think I have is that [tbl1].[stDt] is not on the form with [tbl2].[endDt]. I am placing the code in the form for tbl2, where the check box resides along with the endDt.
Which event should I be using? Or do I have this all messed-up?
Here's the error code:
Run-time error '2465':
Enterprise Audit Database can't find field '|1' referred to in your expression.
Any help would be greatly appreciated.