A very junior programmer here. Needing some help to get the desired results with my code:
What I need my code to do:
1) I want VBA code to examine the value of three textbox controls:
txtbox_RT , txtbox_OT, txtbox_DT "Regular Time, Over Time, and Double Time"
2) Then based on each the values being numeric and > 0, append to a string.
e.g. #2- Lets say for example, txtbox_RT = 10, txtbox_OT = 3, and txtbox_DT = 0
The string should only show "RT = 10 OT =3"
3) Set the string the above string as the value in txtbox_TotalTime.
My Code:
If IsNull Me.txtbox_DT Then
Me.txtbox_TotalTime = "DT:" & Me.[txtbox_DT]
If IsNull Me.txtbox_OT Then
Me.txtbox_TotalTime = "OT:" & Me.[txtbox_OT]
If IsNull Me.txtbox_RT Then
Me.txtbox_TotalTime = "RT:" & Me.[txtbox_RT]
Else
Me.txtbox_TotalTime = "RT:" & Me.[txtbox_RT] & "OT:" & Me.[txtbox_OT] & "DT:" & Me.[txtbox_DT"RT:" & Me.[txtbox_OT]
End IF
What you already know my code does:
My code sets Me.txtbox_TotalTimer to "RT:10 OT:3"
If there is value of 1 in Me.txtbox_DT (other values in my txtboxes remain as "txtbox_RT = 10, txtbox_OT = 3") my code sets Me.txtbox)_TotalTimer to "" meaning nothing/ blank.
Any guidance would be appreciated.
Thank you in advance!