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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROBLEM WITH LOOPS

Status
Not open for further replies.

jodym43

MIS
Aug 24, 2001
14
US
Hey guys,
I'm not sure what I'm doing wrong, but when I try and run the following code.....I get the following message "compile error: Loop without Do statement". As you can see from the following code, I have a Do statement....but I'm not sure where the problem is.

I'd appreciate any help anyone can give, thanks.
jodym43


Do While rst.NoMatch = False
Set rst = dB.OpenRecordset(strSQL)
If rst.NoMatch = False Then
Set MapId = rst("MapID")
Debug.Print "mapID is " & MapId

rst.Edit
rst("MapNeedPurchase").Value = "False"
rst("MapChkPrintOrder").Value = "False"
rst("MapOrdered").Value = "True"
rst("MapOrderDate").Value = Date
rst.Update
Forms!Maps_Order.Refresh
Else: Exit Do
Loop

 
Hi!

You forgot your End If between the Else and the Loop. Access knew there was a problem but it chose the wrong one!

hth
Jeff Bridgham
 
thanks....not it works like it was supposed to---FINALLY!!!

Much appreciated-
jodym43
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top