Loop won't add more than one record to database.
- From: "Rod" <rgg1@xxxxxxxxxxxxx>
- Date: 8 Jun 2006 21:26:01 -0700
I have an array with elements 0 - 5 called mstrDiag . I'm using the
following loop to add non-blank elements to an MS Access table using a
Data Environment.
Dim intIndex As Integer
intIndex = 0
Do
If mstrDiag(intIndex) <> "" Then
With deData.rsDiagnoses
..AddNew
!Diagnosis = mstrDiag(intIndex)
!ptID = mintPNum
..Update
End With
End If
intIndex = intIndex + 1
Loop Until intIndex = 5
As soon as it adds one record, it drops out of the loop and won't add
any more records. I know the array has more than one non-blank element
in it. The same thing happens when using a For/Each/Next loop. Why does
it stop with just one?
I be thankin' ya
Rod
.
- Follow-Ups:
- Re: Loop won't add more than one record to database.
- From: Jan Hyde
- Re: Loop won't add more than one record to database.
- From: Steve Barnett
- Re: Loop won't add more than one record to database.
- Prev by Date: Re: keydown click sound
- Next by Date: Re: VB6, Installsheild, Windows installer.
- Previous by thread: A solution for Ctrl+C problem
- Next by thread: Re: Loop won't add more than one record to database.
- Index(es):
Relevant Pages
|