Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EOF kills procedure instead of continuing to next line

Status
Not open for further replies.

Telsa

Programmer
Jun 20, 2000
393
0
0
US
I have this loop statement that when it reaches the end of the recordset it exits the total procedure process. What I want it to do is just go to the next line. What do I need to do to have it not exit the procedure once EOF is reached?

Do While recBatch!INF <= 3
strColVar = strColVar & recBatch!SoarCollectionPartNum & &quot; &quot;
recBatch.MoveNext

Loop

Mary :)

Violence begets Violence
Let's Give Peace a Chance!!
 
I can't tell what's wrong by what you've posted...

what is recBatch? is that your recordset? are you sure that recBatch!INF has a number less then 3??

What is after this part that you said it's skipping??

(I think it'll be best to include the whole procedure, I know it'd help me at least...)

If your alwas going to be doing just 2 or three of those statements, then you might want to not use a loop, or if you only want to do it if recBatch!INF is 3 or less the logic'll be a bit different...

Sorry, I can't help more then this without more information.

Thanks
--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
I figured it out.

I just needed to add

If recBatch.EOF Then Exit Do

after my recbatch.movenext line

It's the simple things that drive me the battiest! Mary :)

Violence begets Violence
Let's Give Peace a Chance!!
 
glad you figured it out...

since that's what you mean (I didn't understand befor)...

this should also work.
Do While (recBatch!INF <= 3) and (recBatch.eof = false)
'your stuff
loop

I prafer not to just out of loops like that...

--James junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top