chipsworld
Board Regular
- Joined
- May 23, 2019
- Messages
- 164
- Office Version
- 365
Hi all,
Need some guidance...
I have a user form that has a grid that represents 7 years worth of text fields...it also has two text fields which are start date and end date.
it is laid out like... y1jan, y1feb, y1mar, etc all the way through y7dec
y1, y2, y3 etc are all populated with the year based off of a "start" date.
What I am trying to do is fill in the start month based on that start year and then color that month and every month there after until it hits the end date from another field.
I can populate the years pretty simply using y1 = year(startdate) and then y2=y1+1 etc...
My question is...how can I use that date to find the appropriate text field which represents the start month and color it?
i.e.: start date 5/1/15 and color the text field named y1may based upon the month?
Any help on a starting point would be greatly appreciated.
Currently I am populating the y1, y2, y3, etc with the below. txtqmobsrt represents the startdate text field.
Need some guidance...
I have a user form that has a grid that represents 7 years worth of text fields...it also has two text fields which are start date and end date.
it is laid out like... y1jan, y1feb, y1mar, etc all the way through y7dec
y1, y2, y3 etc are all populated with the year based off of a "start" date.
What I am trying to do is fill in the start month based on that start year and then color that month and every month there after until it hits the end date from another field.
I can populate the years pretty simply using y1 = year(startdate) and then y2=y1+1 etc...
My question is...how can I use that date to find the appropriate text field which represents the start month and color it?
i.e.: start date 5/1/15 and color the text field named y1may based upon the month?
Any help on a starting point would be greatly appreciated.
Currently I am populating the y1, y2, y3, etc with the below. txtqmobsrt represents the startdate text field.
VBA Code:
Private Sub txtqmobsrt_AfterUpdate()
Dim mnth
If txtqmobsrt.Value > "" Then
y1 = Year(txtqmobsrt)
y2 = y1 + 1
y3 = y2 + 1
y4 = y3 + 1
y5 = y4 + 1
y6 = y5 + 1
y7 = y6 + 1
mnth = Format(Month(txtqmobsrt), "mmm")
End If
End Sub