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!

Backward For Loop in VBA Access? 1

Status
Not open for further replies.

VBUser77

MIS
Jan 19, 2005
95
0
0
US
I am trying to execute this code:

dim i as variant
dim count as integer

For i = 3 to 1

count = i+2

Next i

It works when I say for i = 1 to 3.

Any ideas or thoughts how to run a for loop with decending values like for i = 3 to 1?

Thanks a lot in advance.

Jay

 
Hi Jay!

Try For i = 3 to 1 Step -1

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Just a thought, if you are using i for an integer loop, is there a reason why you have defined it as variant?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top