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

extract range, create loop, pass parameter

Status
Not open for further replies.

MDA

Technical User
Jan 16, 2001
243
US
Hi all,

I am trying to figure out how extract a range from two combo boxes then pass them to a stored procedure one by one..

Example:
Two combo boxes with 12 months 01 - 12. The first box is a start month and the second box is end month. If the user puts in 01 for start and 06 for end, then I want to pass 01, 02, 03, 04, 05, 06. The stored procedure will run for 01 then when it is finished, VB will pass the next parameter 02, etc, etc. I want to control this in VB and not the SP.

Any ideas on how to do this? I am thinking that after I determine the range, I can create some kind of loop?? Not sure where to start with this idea though...


Thanks for any ideas!!

Regards,
Mike
 


----------------------------------------------------------
For i=val(combo1.value) to val(combo2.value)
YourSub(format(i,"00"))
next i
----------------------------------------------------------

Sunaj
 
Thanks Sunaj,

That worked like a charm!!

Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top