Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21089

[RESOLVED] If .... Then ...... Else Select Case behaviour incorrect ?

$
0
0
Apologies if I am being stupid but I can't understand why both the Then and Else clauses get processed in the following code :-

If MyRs1![MorningRank] = 1 Then G = 1 Else

Select Case MyRs1![PP_Places]

Case 1

G = 1

Case 2

G = MyRs1![StandardValue] - (0.07 * MyRs1![Entropy]) + (0.003 * MyRs1![Runners]) + (0.7 * RootExtras60)

Case 3

G = MyRs1![StandardValue] - (0.07 * MyRs1![Entropy]) + (0.003 * MyRs1![Runners]) + (0.7 * RootExtras70)

Case 4

G = MyRs1![StandardValue]

End Select

When I step through in debug mode I can see that when Morningrank = 1, G first gets set to 1 as required but is then immediately reset via the Select statement when I would have expected it to be ignored.

Any thoughts ? Thanks in anticipation.

Viewing all articles
Browse latest Browse all 21089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>