I have set an unbound checkbox in my form to set a date field using Now() if checked, it also Nulls out the associated date field if unchecked, both using the On Click event:
Private Sub DXF_Chk_Click()
Me.dxfLimits = IIf(Me.DXF_Chk, Now(), Null)
End Sub
This works perfectly, however, when I close and re-open the form and check the same record the checkboxes appear empty. I understand why this is happening - the checkbox isn't bound directly to the Date field - but I need to correct it. My thought was to use an On Load or On Current (both?) event to look at the corresponding date field for not null and make the checkboxes appear checked... but I'm not sure which would be the better option, nor what would make that happen.
I tried to reverse the On Click IIF in the Form Current event:
Private Sub Form_Current()
Me.DXF_Chk = IIf(Me.dxflimits, Now(), Null)
End Sub
and got an error.
Aucun commentaire:
Enregistrer un commentaire