Clearing checkboxes

WinDancer

Registered User.
Local time
Today, 03:36
Joined
Oct 29, 2004
Messages
290
I am trying to clear the checkboxes [one for each record] when I close a form so it opens next time with none of them selected.

I have tried 5 or 6 different ways to do this.
=0
=Null
=""
=false
=no

The most recent, below, doesn't work, either.
No errors, just does not clear them.

Private Sub Command11_Click()
On Error GoTo Command11_Click_Err

Me!ThisOne.Value = -1
DoCmd.Close acForm, "frmSplash", acSaveYes


Command11_Click_Exit:
Exit Sub

Command11_Click_Err:
MsgBox Error$
Resume Command11_Click_Exit

End Sub

Help?
 
1. remember that the acSaveYes in this code:
DoCmd.Close acForm, "frmSplash", acSaveYes
ONLY has to do with DESIGN changes on the object being closed. Not data.

2. Are these bound checkboxes or unbound?

If bound, use an update query to change them.

If unbound, you can set them all to false when you open the form.

Code:
Dim ctl As Control

For Each ctl In Me.Controls
   If ctl.ControlType = acCheckBox Then
      ctl.Value = False
   End If
Next ctl
 
They are bound, and the query did the trick.
Thanks, as always, Bob.
 

Users who are viewing this thread

Back
Top Bottom