L
Lloyd
I have been reading the discussion groups and trying to adapt other example,
but I dont think I am on the right track...
My form is a single form (not continuous). If a user selects a dispo of
Cleared Judicially, I want to check subfrmPersons and make sure that on EACH
person the "Suspect" is in custody by selecting the "InCustody" control for a
true value.
The code below works for the first record, but if it finds the first person
that meets the criteria, then it stops. I tried using .FindNext, but that
doesnt seem to work at all since the first code does the .FindFirst and then
the code is done.
How do I look through all the persons in the current record to see if
"InCustody" is checked on all of them? Do I need to do a loop (Havnt done
one of those before)??
help please....
'Checks to make sure all suspects are in custody before allowing user to
clear case Judicially
If Me.Dispo = "Cleared Judicially" Then
With Me.subfrmPersons.Form.RecordsetClone
Select Case Me.CaseType
Case "Murder"
.FindFirst "[PersonType] = ""Suspect"""
'Checks the in-custody control, 0 = false (not
checked), -1 = True (checked)
If Me.subfrmPersons.Form.InCustody = 0 Then
MsgBox "You can not clear this case
Judicially as not all suspects are in custody", vbQuestion, "Are all suspects
really in custody?"
Me.Undo
End If
Case "Murder"
.FindNext "[PersonType] = ""Suspect"""
If Me.subfrmPersons.Form.InCustody = 0 Then
MsgBox "You can not clear this case
Judicially as not all suspects are in custody", vbQuestion, "Are all suspects
really in custody?"
Me.Undo
' End If
End Select
End With
End If
but I dont think I am on the right track...
My form is a single form (not continuous). If a user selects a dispo of
Cleared Judicially, I want to check subfrmPersons and make sure that on EACH
person the "Suspect" is in custody by selecting the "InCustody" control for a
true value.
The code below works for the first record, but if it finds the first person
that meets the criteria, then it stops. I tried using .FindNext, but that
doesnt seem to work at all since the first code does the .FindFirst and then
the code is done.
How do I look through all the persons in the current record to see if
"InCustody" is checked on all of them? Do I need to do a loop (Havnt done
one of those before)??
help please....
'Checks to make sure all suspects are in custody before allowing user to
clear case Judicially
If Me.Dispo = "Cleared Judicially" Then
With Me.subfrmPersons.Form.RecordsetClone
Select Case Me.CaseType
Case "Murder"
.FindFirst "[PersonType] = ""Suspect"""
'Checks the in-custody control, 0 = false (not
checked), -1 = True (checked)
If Me.subfrmPersons.Form.InCustody = 0 Then
MsgBox "You can not clear this case
Judicially as not all suspects are in custody", vbQuestion, "Are all suspects
really in custody?"
Me.Undo
End If
Case "Murder"
.FindNext "[PersonType] = ""Suspect"""
If Me.subfrmPersons.Form.InCustody = 0 Then
MsgBox "You can not clear this case
Judicially as not all suspects are in custody", vbQuestion, "Are all suspects
really in custody?"
Me.Undo
' End If
End Select
End With
End If