RE: do until

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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!


.



Relevant Pages

  • Re: do until
    ... loop can go to the next record otherwise it keeps looping through the first ... I have a table called ACH that I search for a customer id and find out ... Set rsCustomer = dbType.OpenRecordset("Customer", ...
    (microsoft.public.access.modulesdaovba)
  • RE: loops
    ... I have the following piece of code which checks the customer and product ... I have now realised that I need to enter a qty for price breaks so the loop ... Loop While Not C Is Nothing And C.Address firstAddress ...
    (microsoft.public.excel.programming)
  • RE: loops
    ... I have the following piece of code which checks the customer and product ... I have now realised that I need to enter a qty for price breaks so the loop ... Loop While Not C Is Nothing And C.Address firstAddress ...
    (microsoft.public.excel.programming)
  • Re: Looking for a way to convert dec to bin
    ... 'do stuff including exit sub ... For each Customer in Customers ... or For Each loop, I see something that I expect to run from start to finish. ... use a loop that's a couple of lines shorter or longer, ...
    (microsoft.public.vb.general.discussion)
  • Re: Two quick RS-485 questions
    ... > plan to stick an RS485 driver on an AVR, ... proper 'driver' at the TX side while all receivers are merely cheap ... > I and the customer have metric truckloads of the stuff lying about. ... With 2400 bps and a current loop you could even use fence wire. ...
    (comp.arch.embedded)