Jonny45wakey
Member
- Local time
- Today, 09:53
- Joined
- May 4, 2020
- Messages
- 40
Hi All
Struggling to correctly structure the VBA to do the following, any help is much appreciated. :-
I have a textbox called "status" on a form which has conditional formatting applied and dependent on values in other textboxes the status textbox value should change and subsequently change colour too!
Other textboxes on the form which support this operation are:-
txtMonth_Raised (obtains the mm from txtDate_Raised)
txtCurrent_Month (obtains the mm from =Now())
txtForecast_Completion_Date (entered on form when applicable)
txtDate_Closed (entered on form when applicable)
txtDate_Raised (entered on form when applicable)
txtForecast_month (obtains mm from txtForecast_Completion_Date)
The logic should work as follows:-
1. If forecast_completion_date textbox is empty then me.status.value = "New" - status box turns blue
2. If forecast_completion_date textbox isn't empty then me.status.value = "Ongoing" - status box turns amber
3. If Date_closed textbox isn't empty then me.status.value = "Completed" - status box turns green
4. If Date_closed textbox is empty and txtForecast_month is less than txtCurrent_Month then me.status.value = "Overdue" - status box turns red
Hope this makes sense and someone better at VBA than me can structure this code for me.
Thanks in advance
Jonny
Struggling to correctly structure the VBA to do the following, any help is much appreciated. :-
I have a textbox called "status" on a form which has conditional formatting applied and dependent on values in other textboxes the status textbox value should change and subsequently change colour too!
Other textboxes on the form which support this operation are:-
txtMonth_Raised (obtains the mm from txtDate_Raised)
txtCurrent_Month (obtains the mm from =Now())
txtForecast_Completion_Date (entered on form when applicable)
txtDate_Closed (entered on form when applicable)
txtDate_Raised (entered on form when applicable)
txtForecast_month (obtains mm from txtForecast_Completion_Date)
The logic should work as follows:-
1. If forecast_completion_date textbox is empty then me.status.value = "New" - status box turns blue
2. If forecast_completion_date textbox isn't empty then me.status.value = "Ongoing" - status box turns amber
3. If Date_closed textbox isn't empty then me.status.value = "Completed" - status box turns green
4. If Date_closed textbox is empty and txtForecast_month is less than txtCurrent_Month then me.status.value = "Overdue" - status box turns red
Hope this makes sense and someone better at VBA than me can structure this code for me.
Thanks in advance
Jonny