I have two combo boxes that contain start and end "Periods." For example Start 0201 - End 0212 (YYMM).
I am having a problem in looping through the periods when I use 0001 - 0012. I am currently using the following syntax:
Dim i As Integer
For i = Val(cmbFromPE.Text) To Val(cmbtoPE.Text)
msgbox "0" & i
Next
So if I enter from: 0201 and to: 0203
It will return 0201,0202,0203 (THIS IS CORRECT)
BUT if I enter 0001 - 0003
I get back 01,02,03 (NOT CORRECT). This is because I am using type Interger for i. However, I don't know what other datatype I can use to loop through mutiple periods.
Any ideas?
Thanks in advance.
MDA
I am having a problem in looping through the periods when I use 0001 - 0012. I am currently using the following syntax:
Dim i As Integer
For i = Val(cmbFromPE.Text) To Val(cmbtoPE.Text)
msgbox "0" & i
Next
So if I enter from: 0201 and to: 0203
It will return 0201,0202,0203 (THIS IS CORRECT)
BUT if I enter 0001 - 0003
I get back 01,02,03 (NOT CORRECT). This is because I am using type Interger for i. However, I don't know what other datatype I can use to loop through mutiple periods.
Any ideas?
Thanks in advance.
MDA