check box - change othert

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I know to create checkbox on continiuos form that will check the other
other checkboxes on the same form.
it go like this.......
" Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.ControlType = acCheckBox Then
ctrl = Me.ActiveControl
End If
Next ctrl "

but now i want to check only those records that gos after (below)
the check box that i check.
HOW ?
 
תודה רבה,

I would not do it like this. I would use an Update Query. Similarly,
with your request, I would use an Update Query. We need to have a way
of knowing, *based on your data*, which records are "below" the current
record. So, what determines the sort order of the records on the
continuous form? Do you have a date field, or an incremental number
field, we can use to decide which records are "below"? Then, we can go
(as an example):

CurrentDb.Execute "UPDATE MyTable SET MyYesNoField = -1 WHERE MyID > " &
Me.ID
 
תודה רבה,

Yes, you can do this on the After Update event of the checkbox.

If Me.MyYesNoField Then
CurrentDb.Execute "UPDATE MyTable SET MyYesNoField = -1 WHERE ID > "
& Me.ID, dbFailOnError
Me.Requery
End If
 
Back
Top