Yes, Alastair, asking for a "CreationDate" when you actually want a
"CompletionDate" is a little ambiguous! Here's two sets of code to do it. If
you ***only*** have 7 checkboxes on your form, in total
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim ctrl As Control
Dim Counter As Integer
Counter = 0
For Each ctrl In Me.Controls
If TypeOf ctrl Is CheckBox Then
If ctrl = -1 Then
Counter = Counter + 1
End If
End If
Next
If IsNull(Me.DateCompleted) And Counter = 7 Then
Me.DateCompleted = Date
End If
End Sub
If, on the other hand, you have more than 7 checkboxes on your form, but are
only concerned with the magic 7 for you completion date, for each of those 7
you need to goto Properties - Other and enter "marked" (without the quotes)
in the Tag Property of each, then use this code instead:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim ctrl As Control
Dim Counter As Integer
Counter = 0
For Each ctrl In Me.Controls
If TypeOf ctrl Is CheckBox Then
If ctrl.Tag = "marked" And ctrl = -1 Then
Counter = Counter + 1
End If
End If
Next
If IsNull(Me.DateCompleted) And Counter = 7 Then
Me.DateCompleted = Date
End If
End Sub
This assumes that once all 7 are checked you won't go back and unmark any. If
you want this possibility addressed you'd have to have more code to cover the
possibility.