loop question

D

DrEvil

Hi guys,
my question is about looping, I have payments form and within it I have
continuous subform, I have checkbox called PaidInFull on subform which I
check to see if this return has been paid in full, we can have multiple
partial payments or one full payment.
I'm using this loop code to check if PaidInFull has been set to true in any
of the records in continuous sub-form and If I find it I would exit loop and
set form properties.
It only works it the first record is paid in full, if 3rd record is the one
that tripped paid in full checkbox it will not work and when I debug it tell
me that value is 0 and it's not but it loops just fine through each record...
any reason for this;

Dim rst As Object
Set rst = Me.RecordsetClone
If rst.RecordCount > 0 Then
rst.MoveFirst
Do While Not rst.EOF
If PaidInFull = True Then
Form.AllowAdditions = False
Form.AllowDeletions = False
Form.AllowEdits = False
Exit Sub
ElseIf PaidInFull = False Then
Form.AllowAdditions = True
Form.AllowDeletions = True
Form.AllowEdits = True
End If

rst.MoveNext
Loop
End If
Set rst = Nothing

Thanx for all the help!
 
T

Tom Lake

DrEvil said:
Hi guys,
my question is about looping, I have payments form and within it I have
continuous subform, I have checkbox called PaidInFull on subform which I
check to see if this return has been paid in full, we can have multiple
partial payments or one full payment.
I'm using this loop code to check if PaidInFull has been set to true in any
of the records in continuous sub-form and If I find it I would exit loop and
set form properties.
It only works it the first record is paid in full, if 3rd record is the one
that tripped paid in full checkbox it will not work and when I debug it tell
me that value is 0 and it's not but it loops just fine through each record...
any reason for this;

Don't you have to use Rst.PaidInFull rather than just PaidInFull?

Tom Lake
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top