If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Reset value to False in Checkbox when closing form
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? -- ndl |
#2
|
|||
|
|||
Reset value to False in Checkbox when closing form
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 "nlandsnes" wrote in message ... 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? -- ndl |
Thread Tools | |
Display Modes | |
|
|