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!

vbOKCancel BREAK?

Status
Not open for further replies.

tomatojo

Technical User
Dec 10, 2010
8
0
0
US
Hi, I'm using VB in an Access 97 program I have. I'm using the vbOKCancel message box command. But it runs in a look and sometime (during program testing) I want it to break out of the loop. Now, if I click OK, it continues with program as planned (works well). When I click Cancel it skips over the step (as planned) and goes to the next item in the loop (If-Then loop). But every once in awhile, I need to Break out of the loop completely. How do I accomplish this? Is there such a thing as vbokcancelbreak?
 
How do I exit and If Then statement (like I'm using)? I keep getting errors (missing end if with if statement, and as far as I can tell, its there!). It worked when it was a vbOKCancel so maybe it doesn't work with vbyesno?
 
Got it working now, I just used Exit Sub instead of Edit Do. Thnx!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top