Reset value to False in Checkbox when closing form

  • Thread starter Thread starter nlandsnes
  • Start date Start date
N

nlandsnes

I have a split form with a Checkbox called "Select" it's default value is
False (0)
when I close the form I want the field value (if changed) to be reset to
False (0).
In my form I have an event procedure under On Close:

Private Sub Form_Close()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acCheckBox Then
ctl.Value = False
End If
Next
End Sub

When I close the form I get an error message: Run-time error 2448 "You can't
assign a value to this object."
Any ideas where I've gone wrong?
 
The close event is too late for what you want to do. To make changes to
unbound controls, use the Unload event of the form.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top