I have a field that stores a recurrence pattern that is imported from outlook
example recurrence pattern
(3,20101208,10:00:00,1,0,4,120,2,20110331,12:00:00 ,)
The pattern is not always the same length so it could have up to 13 elements.
I need to split this field up and assign the different elements to variables I have done this using an array
I am getting Run-time error 9 because the array is not always the same length
using the above example I get the error on the following line
Expand|Select|Wrap|Line Numbers
- MonthOfYear = aStringArray(11)
Expand|Select|Wrap|Line Numbers
- Dim aStringArray() As String 'array of strings
- RecPattern = RstCheckRec!RecPattern ' this the outlook recurrence pattern stored in the table I need to seperate these elements
- aStringArray = Split(RecPattern, ",") 'split string up
- 'assigns the variables with the values from the the recurrence pattern stored in the table
- RecType = aStringArray(0)
- StartDate = aStringArray(1)
- StartTime = aStringArray(2)
- Interval = aStringArray(3)
- NoEndDate = aStringArray(4)
- Occurrences = aStringArray(5)
- Duration = aStringArray(6)
- Instance = aStringArray(7)
- EndDate = aStringArray(8)
- EndTime = aStringArray(9)
- DayOfMonth = aStringArray(10)
- MonthOfYear = aStringArray(11)
- Regenerate = aStringArray(12)
- DayOfWeekMask = aStringArray(13)
Phill