By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

access 97: do without loop error and nesting problems

P: n/a
help! i'm caught in the endless of "compile error message: do without
loop." i thought that i closed all of my statments but it appears
not. does anyone know why my structure is incorrect?

what i'm trying to do is to find "series key" and if so, then parse
the appropriate data. then if it finds "issuer" it needs to exit.

thanks in advance!!!
jung.
Set rst = dbs.OpenRecordset("Test", dbOpenDynaset)
Set rstclean = dbs.OpenRecordset("CDtest", dbOpenDynaset)
rst.MoveFirst
Do Until rst.EOF
'Open Current Record for editing
If x = InStr(rst![Field1].Value, "SERIES KEY") Then
Do While InStr(rst![Field1].Value, "SERIES KEY") <> 0
rst.MoveNext
rst.MoveNext
rst.MoveNext
Do Until IsNumeric(x) = False
rstclean.AddNew
key = rst![Field1].Value & " "
'etoile = rst![Field2].Value & " "
Pay = rst![Field2].Value & " "
Coll = rst![Field3].Value & " "
cashbalance = rst![Field4].Value & " "
rstclean![series].Value = key
'rstclean![Star].Value = etoile
rstclean![Payments].Value = Pay
rstclean![Collections].Value = Coll
rstclean![CashBal].Value = cashbalance

rstclean.Update
rst.MoveNext
x = Len(rst![Field1].Value)
Loop
rst.MoveNext
Loop
rst.MoveNext

ElseIf InStr(rst![Field2].Value, " ISSUER") <> 0 Then
Loop
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"ElseIf InStr(rst![Field2].Value, " ISSUER") <> 0 Then" needs a body
and an "End If" before the "Loop" statement.

On 3 Mar 2004 16:15:51 -0800, pi******@yahoo.fr (JMCN) wrote:
help! i'm caught in the endless of "compile error message: do without
loop." i thought that i closed all of my statments but it appears
not. does anyone know why my structure is incorrect?

what i'm trying to do is to find "series key" and if so, then parse
the appropriate data. then if it finds "issuer" it needs to exit.

thanks in advance!!!
jung.
Set rst = dbs.OpenRecordset("Test", dbOpenDynaset)
Set rstclean = dbs.OpenRecordset("CDtest", dbOpenDynaset)
rst.MoveFirst
Do Until rst.EOF
'Open Current Record for editing
If x = InStr(rst![Field1].Value, "SERIES KEY") Then
Do While InStr(rst![Field1].Value, "SERIES KEY") <> 0
rst.MoveNext
rst.MoveNext
rst.MoveNext
Do Until IsNumeric(x) = False
rstclean.AddNew
key = rst![Field1].Value & " "
'etoile = rst![Field2].Value & " "
Pay = rst![Field2].Value & " "
Coll = rst![Field3].Value & " "
cashbalance = rst![Field4].Value & " "
rstclean![series].Value = key
'rstclean![Star].Value = etoile
rstclean![Payments].Value = Pay
rstclean![Collections].Value = Coll
rstclean![CashBal].Value = cashbalance

rstclean.Update
rst.MoveNext
x = Len(rst![Field1].Value)
Loop
rst.MoveNext
Loop
rst.MoveNext

ElseIf InStr(rst![Field2].Value, " ISSUER") <> 0 Then
Loop


Nov 12 '05 #2

P: n/a
You did not close your IF statement. It requires an End If. Sometimes
compile errors having to do with any type of loop can be deceiving. Almost
as if the compiler just picks the first block when any End statement is
missing. Also, I'm not sure what you are trying to do with the last two
lines, so they may or may not cause a problem. If not an error, then likely
a logical one.

Mike Storr
www.veraccess.com
"JMCN" <pi******@yahoo.fr> wrote in message
news:27*************************@posting.google.co m...
help! i'm caught in the endless of "compile error message: do without
loop." i thought that i closed all of my statments but it appears
not. does anyone know why my structure is incorrect?

what i'm trying to do is to find "series key" and if so, then parse
the appropriate data. then if it finds "issuer" it needs to exit.

thanks in advance!!!
jung.
Set rst = dbs.OpenRecordset("Test", dbOpenDynaset)
Set rstclean = dbs.OpenRecordset("CDtest", dbOpenDynaset)
rst.MoveFirst
Do Until rst.EOF
'Open Current Record for editing
If x = InStr(rst![Field1].Value, "SERIES KEY") Then
Do While InStr(rst![Field1].Value, "SERIES KEY") <> 0
rst.MoveNext
rst.MoveNext
rst.MoveNext
Do Until IsNumeric(x) = False
rstclean.AddNew
key = rst![Field1].Value & " "
'etoile = rst![Field2].Value & " "
Pay = rst![Field2].Value & " "
Coll = rst![Field3].Value & " "
cashbalance = rst![Field4].Value & " "
rstclean![series].Value = key
'rstclean![Star].Value = etoile
rstclean![Payments].Value = Pay
rstclean![Collections].Value = Coll
rstclean![CashBal].Value = cashbalance

rstclean.Update
rst.MoveNext
x = Len(rst![Field1].Value)
Loop
rst.MoveNext
Loop
rst.MoveNext

ElseIf InStr(rst![Field2].Value, " ISSUER") <> 0 Then
Loop

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.