|
-
Apr 11th, 2011, 04:28 AM
#1
Thread Starter
PowerPoster
LOOP and array
I loop a series of date from a for next cicle
similar:
For Each olItm In olFld.Items
If InStr(olItm.Subject, "abd") Then
TEST = olItm.ReceivedTime
'here store date into array
End If
Next
i need to store all dates from the loop and when the loop finish extract the newst date from array, is possible?
Note:
Test is dimensioned as Date
-
Apr 11th, 2011, 04:37 AM
#2
Fanatic Member
Re: LOOP and array
before doing any processing on your recordset, why not use the '.sort' method first to get the data into the order you want.
-
Apr 11th, 2011, 04:46 AM
#3
Lively Member
Re: LOOP and array
Yes just after storing date into the array, use sorting of all recordset by Date in ascending / descending order so that it will be arranged as per date and you will get the sorted data.
-
Apr 11th, 2011, 04:54 AM
#4
Thread Starter
PowerPoster
Re: LOOP and array
 Originally Posted by Bill Crawley
before doing any processing on your recordset, why not use the '.sort' method first to get the data into the order you want.
hummmmm....
my code go in error:
Code:
....
Dim ARRAY_DATE() As Date 'Array DELLE DATE
....
I=0
For Each olItm In olFld.Items
If InStr(olItm.Subject, "te") Then
TEST = olItm.ReceivedTime
ARRAY_DATE(I) = Format(TEST, "DD/MM/YYYY")
I = I + 1
End If
Next
Last edited by luca90; Apr 13th, 2011 at 04:34 AM.
-
Apr 13th, 2011, 12:23 PM
#5
Lively Member
Re: LOOP and array
I think if u post ur code with data file, it will be easy to help.
-
Apr 13th, 2011, 12:31 PM
#6
Thread Starter
PowerPoster
Re: LOOP and array
 Originally Posted by Smartchap
I think if u post ur code with data file, it will be easy to help.
01/01/2011 05.00.11 <- Selected
01/01/2011 19.00.14
01/01/2011 21.21.11
02/01/2011 05.00.02 <- Selected
03/01/2011 01.00.03 <- Selected
03/01/2011 12.17.21
03/01/2011 18.00.27
if is most simple i post my question on other side:
Admitting i loop the series of value with a for next how to fill combobox items with the value marked with < - Selected
In effect i need to fill the items oin combo with the dates vale with the oldest time
-
Apr 13th, 2011, 12:34 PM
#7
Re: LOOP and array
You're not re-dimensioning the Dynamic Array
Code:
....
Dim ARRAY_DATE() As Date 'Array DELLE DATE
....
I=0
For Each olItm In olFld.Items
If InStr(olItm.Subject, "te") Then
TEST = olItm.ReceivedTime
ReDim Preserve ARRAY_DATE(I)
ARRAY_DATE(I) = Format(TEST, "DD/MM/YYYY")
I = I + 1
End If
Next
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|