RE: do until
- From: Maurice <Maurice@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 May 2007 11:49:02 -0700
I know you know this one. You have to put a rs.movenext in your code so the
loop can go to the next record otherwise it keeps looping through the first
record.
hth
--
Maurice Ausum
"newkid" wrote:
Hi everyone,.
I have a table called ACH that I search for a customer id and find out
if that customer has passthru, upload or application. Each customer
can have both passthru and application. If they have both, they will
be in seperate records.The customer table has two fields. One for
Passthru and one for application. If pasthru or upload is located, I
open the Customer table and mark the passthru or application TRUE.
Here's the problem. I'm using findnext customer id as my search within
a loop. So of course I'm getting locked in an infinate loop.
Could someone help me get out of the infinite loop or I'm open to a
completely new way of locating the records in the ach table.
With rsACH
.MoveFirst
.FindFirst "[Customer ID] = " & lngCustomer & ""
Do Until rsACH.EOF = True
If rsACH![UploadOrApp] = "PassThru" Or rsACH!
[UploadOrApp] = "Upload" Then
Set rsCustomer = dbType.OpenRecordset("Customer",
dbOpenDynaset, dbSeeChanges)
With rsCustomer
.FindFirst "[Customer ID] = " & lngCustomer & ""
.Edit
![ACH File Upload] = True
.Update
End With
Else
If rsACH![UploadOrApp] = "Application" Then
Set rsCustomer = dbType.OpenRecordset("Customer",
dbOpenDynaset, dbSeeChanges)
With rsCustomer
.FindFirst "[Customer ID] = " & lngCustomer & ""
.Edit
![ACH Application] = True
.Update
End With
End If
End If
rsACH.FindNext "[Customer ID] = " & lngCustomer & ""
Loop
End With
rsACH.Close
rsCustomer.Close
Thank all!
- Follow-Ups:
- Re: do until
- From: newkid
- Re: do until
- References:
- do until
- From: newkid
- do until
- Prev by Date: Re: Excel's MAX function in Access
- Next by Date: Re: Database Forced Input
- Previous by thread: do until
- Next by thread: Re: do until
- Index(es):
Relevant Pages
|