gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,276
- Office Version
-
- 365
- Platform
-
- Windows
I have three TextBoxes. Two have values where the user is entering information. But my third I want to autopopulate with data from the first two
The first one is "EscalationBaseDate" it is a date field (Example: 2021/12/15)
The first one is "EscalationBaseDate" it is a date field (Example: 2021/12/15)
Code:
Private Sub EscalationBaseDate_Exit(ByVal Cancel As MSForms.ReturnBoolean)
With EscalationBaseDate
If IsDate(.Value) = True Then
.Value = format(.Value, "YYYY/MM/DD")
ElseIf .Value = "" Then
.Value = .Value
ElseIf IsDate(.Value) = False Then
MsgBox "Enter a date", 48, "Invalid Entry"
.Value = ""
Cancel = True
End If
End With
End Sub
[code/]
The second is IHSEscCode Which is text (Example: PPI3359291)
My Third TexBox on my userform is called EscRate I need to concatenate the first two but only using the year from the first one and a "-" placed in-between.
So in this case the third text box would be "PPI3359291-2021"
EscRate.Value= ?
I dont know how to parse our the year and concatenate that. Any help is appreciated - Thank you!