Stuck in an Infinite Loop

G

Guest

Okay, folks...

I can not, for the life of me, see where my mistake is. I need another set
of eyes.

I am trying to loop through a Case statement, and want the loop to exit once
my variable reaches a specific value (36). Here is my most recent version of
code:

Dim outcome1 As Double
outcome1 = [Forms]![subfrmtestbetpercfix1]![outcomeid]

If outcome1 < 36 Then
Do Until outcome1 = 36

Select Case outcome1
Case 31
DoCmd.RunSQL ("update ...
Case 32
DoCmd.RunSQL ("update ...
Case 33
DoCmd.RunSQL ("update ...
Case 34
DoCmd.RunSQL ("update ...
Case 35
DoCmd.RunSQL ("update ...
End Select

Loop
Else
End If

The Update statement(s) work properly, but as the title states, the loop
continues, even after the variable reaches 36. I know it should be slapping
me in the face, but I'm just not seeing the problem.

Thanks, in advance.

Sharkbyte
 
G

Guest

Answered my own question. =P

For whatever reason it never dawned on me to move enclose everything inside
the Do Until/Loop.

Thanks.

Sharkbyte
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top