MCTampa
Board Regular
- Joined
- Apr 14, 2016
- Messages
- 97
I am building a macro to change values in our IBM AS400.
I need my macro to evaluate each line and determine if the date for that line satisfies a criteria.
My dates are formatted as such: 01APR19
These value are on row 7 starting with position 51 (the 0) and ending with position 57 (the 9)
I have the date range that the AS400 value needs to satisfy in an Access Table.
I am trying say "If the date in AS400 is less than or equal to the End Date in my table, do..."
My code is as follows
What I am trying to achieve is a DateSerial that utilizes the 19 for the year, the 4 for the month and the 01 for the day.
However this is not working.
Any help would be appreciated.
Mike
I need my macro to evaluate each line and determine if the date for that line satisfies a criteria.
My dates are formatted as such: 01APR19
These value are on row 7 starting with position 51 (the 0) and ending with position 57 (the 9)
I have the date range that the AS400 value needs to satisfy in an Access Table.
I am trying say "If the date in AS400 is less than or equal to the End Date in my table, do..."
My code is as follows
Code:
Dim sdmonth as Integer
If PS.GetText(7, 53, 3) = "APR" Then sdmonth = 4
If Date(Serial(PS.GetText(14, 56, 2), sdmonth, PS.GetText(14, 51, 2) <= Fields.("End_Date") then....
What I am trying to achieve is a DateSerial that utilizes the 19 for the year, the 4 for the month and the 01 for the day.
However this is not working.
Any help would be appreciated.
Mike