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

very new at this 1

Status
Not open for further replies.

Alli

Technical User
Mar 3, 2000
1
US
I need to write a click event procedure to count from 1 to 20 using a DO-LOOP. And declaring the variables at the form level<br>
I wrote this at the form level<br>
Dim intcount as variable<br>
<br>
At the cmdcount_click level I wrote,<br>
<br>
intcount=intcount + 1<br>
Do while intcount&lt;= 20<br>
loop <br>
print intcount<br>
Now for those of you who know this already this is way easy<br>
however I'm brand new and I can not get this to run any suggestions. besides the obvious like get out of programming
 
Don't give up yet, Alli. From simple beginnings come the world-class programmers. <br>

<br>

Dim IntCount as Integer (if you remove the Option Explicit line this declaration is unnecessary).<br>

<br>

You have to place intcount = intcount + 1 and your command to show the value of IntCount inside the Do...Loop.<br>

<br>

May I suggest that you create a label on your form and output the results to it, rather than Debug.Print?<br>

<br>

Try:<br>

Do while intcount < 20<br>

intcount = intcount + 1<br>

Label1 = intcount<br>

Loop<br>

<br>

Of course, on execution, Label1 will always display "20". Computers are just too fast. Don't let that bother you.<br>

<br>




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top