jeffcityman
New member
- Local time
- Today, 15:19
- Joined
- Jun 20, 2012
- Messages
- 9
Hello to all,
I'm needing help with setting up a field (or control) in a Form to automatically fill in a number based on a date field. For example, in my form I have a field labeled "TRANS DATE". Users enter a date (such as 7/5/2013). I have another field labeled "FISCAL YR". I would like for FISCAL YR to be auto-filled with the last two digits of the year, based on the date entered in TRANS DATE. For example, if the date 7/1/2012 is entered in the TRANS DATE field, then I would want 13 to be auto-filled in the FISCAL YR field.
I've tried the After Update in an Event Procedure but haven't been successful yet. Below is one of the options I've tried:
If Me.TRANS_DATE = "Between 7/1/2012 and 6/30/2013" Then
Me.FISCAL_YR = 13
If Me.TRANS_DATE = "Between 7/1/2013 and 6/30/2014" Then
Me.FISCAL_YR = 14
If Me.TRANS_DATE = "Between 7/1/2014 and 6/30/2015" Then
Me.FISCAL_YR = 15
I've tried the # sign before and after the dates as well, with no luck.
I'm not sure if I'm doing the End If or End Sub part of it correctly either.
Thanks for listening!
I'm needing help with setting up a field (or control) in a Form to automatically fill in a number based on a date field. For example, in my form I have a field labeled "TRANS DATE". Users enter a date (such as 7/5/2013). I have another field labeled "FISCAL YR". I would like for FISCAL YR to be auto-filled with the last two digits of the year, based on the date entered in TRANS DATE. For example, if the date 7/1/2012 is entered in the TRANS DATE field, then I would want 13 to be auto-filled in the FISCAL YR field.
I've tried the After Update in an Event Procedure but haven't been successful yet. Below is one of the options I've tried:
If Me.TRANS_DATE = "Between 7/1/2012 and 6/30/2013" Then
Me.FISCAL_YR = 13
If Me.TRANS_DATE = "Between 7/1/2013 and 6/30/2014" Then
Me.FISCAL_YR = 14
If Me.TRANS_DATE = "Between 7/1/2014 and 6/30/2015" Then
Me.FISCAL_YR = 15
I've tried the # sign before and after the dates as well, with no luck.
I'm not sure if I'm doing the End If or End Sub part of it correctly either.
Thanks for listening!