I've built a User Form that will update a few different worksheets. I have a few date fields that won't always be populated, if the Client doesn't sign up for particular services. When I test the form, I'm getting an error because the date is null. I don't want to populate the field with text, as there are some calculations that I'll be building in, based off dates. I'm thinking some sort of error handling might work, but I've never worked with error handling before and honestly, I'm still quite new to VBA. I've pasted the code in question below, with the impacted line in red font. Thoughts on the best approach?
Private Sub cmd_Submit_Click()
Dim LastRow As Long
Dim LastRow2 As Long
Dim LastRow3 As Long
Set ws1 = ThisWorkbook.Sheets("Client Info")
Set ws2 = ThisWorkbook.Sheets("Client Measurements")
Set ws3 = ThisWorkbook.Sheets("Payment Tracker")
LastRow = ws1.Range("C" & Rows.Count).End(xlUp).Row + 1
LastRow2 = ws2.Range("C" & Rows.Count).End(xlUp).Row + 1
LastRow3 = ws3.Range("C" & Rows.Count).End(xlUp).Row + 1
ws1.Range("B" & LastRow).Value = CDate(Me.txt_Updated)
ws1.Range("C" & LastRow).Value = (Me.txt_First)
ws1.Range("D" & LastRow).Value = (Me.txt_Last)
ws1.Range("E" & LastRow).Value = (Me.txt_Suffix)
ws2.Range("B" & LastRow2).Value = CDate(Me.txt_Updated)
ws2.Range("C" & LastRow2).Value = (Me.txt_First)
ws2.Range("D" & LastRow2).Value = (Me.txt_Last)
ws2.Range("E" & LastRow2).Value = (Me.txt_Suffix)
ws1.Range("G" & LastRow).Value = CDate(Me.txt_DoB)
ws1.Range("H" & LastRow).Value = (Me.cobo_Gender)
ws1.Range("I" & LastRow).Value = (Me.txt_SignupAge)
ws1.Range("K" & LastRow).Value = (Me.txt_Phone)
ws1.Range("L" & LastRow).Value = (Me.txt_Email)
ws1.Range("M" & LastRow).Value = CDate(Me.txt_DPStart)
ws1.Range("N" & LastRow).Value = CDate(Me.txt_DCStart)
ws1.Range("O" & LastRow).Value = CDate(Me.txt_OCStart)
ws1.Range("P" & LastRow).Value = CDate(Me.txt_CTIStart)
ws1.Range("Q" & LastRow).Value = CDate(Me.txt_CTOStart)
ws2.Range("G" & LastRow2).Value = (Me.cobo_EntryType)
ws2.Range("H" & LastRow2).Value = (Me.txt_Height)
ws2.Range("I" & LastRow2).Value = (Me.txt_Weight)
ws2.Range("J" & LastRow2).Value = (Me.txt_Chest)
ws2.Range("K" & LastRow2).Value = (Me.txt_Hips)
ws2.Range("L" & LastRow2).Value = (Me.txt_Waist)
ws2.Range("M" & LastRow2).Value = (Me.txt_BicepL)
ws2.Range("N" & LastRow2).Value = (Me.txt_BicepR)
ws2.Range("O" & LastRow2).Value = (Me.txt_ThighL)
ws2.Range("P" & LastRow2).Value = (Me.txt_ThighR)
ws2.Range("Q" & LastRow2).Value = (Me.txt_CalfL)
ws2.Range("R" & LastRow2).Value = (Me.txt_CalfR)
Me.txt_Updated = ""
Me.txt_First = ""
Me.txt_Last = ""
Me.txt_Suffix = ""
Me.txt_Updated = ""
Me.txt_First = ""
Me.txt_Last = ""
Me.txt_Suffix = ""
Me.txt_DoB = ""
Me.cobo_Gender = ""
Me.txt_SignupAge = ""
Me.txt_Phone = ""
Me.txt_Email = ""
Me.txt_DPStart = ""
Me.txt_DCStart = ""
Me.txt_OCStart = ""
Me.txt_CTIStart = ""
Me.txt_CTOStart = ""
Me.cobo_EntryType = ""
Me.txt_Height = ""
Me.txt_Weight = ""
Me.txt_Chest = ""
Me.txt_Hips = ""
Me.txt_Waist = ""
Me.txt_BicepL = ""
Me.txt_BicepR = ""
Me.txt_ThighL = ""
Me.txt_ThighR = ""
Me.txt_CalfL = ""
Me.txt_CalfR = ""
End Sub
Private Sub cmd_Submit_Click()
Dim LastRow As Long
Dim LastRow2 As Long
Dim LastRow3 As Long
Set ws1 = ThisWorkbook.Sheets("Client Info")
Set ws2 = ThisWorkbook.Sheets("Client Measurements")
Set ws3 = ThisWorkbook.Sheets("Payment Tracker")
LastRow = ws1.Range("C" & Rows.Count).End(xlUp).Row + 1
LastRow2 = ws2.Range("C" & Rows.Count).End(xlUp).Row + 1
LastRow3 = ws3.Range("C" & Rows.Count).End(xlUp).Row + 1
ws1.Range("B" & LastRow).Value = CDate(Me.txt_Updated)
ws1.Range("C" & LastRow).Value = (Me.txt_First)
ws1.Range("D" & LastRow).Value = (Me.txt_Last)
ws1.Range("E" & LastRow).Value = (Me.txt_Suffix)
ws2.Range("B" & LastRow2).Value = CDate(Me.txt_Updated)
ws2.Range("C" & LastRow2).Value = (Me.txt_First)
ws2.Range("D" & LastRow2).Value = (Me.txt_Last)
ws2.Range("E" & LastRow2).Value = (Me.txt_Suffix)
ws1.Range("G" & LastRow).Value = CDate(Me.txt_DoB)
ws1.Range("H" & LastRow).Value = (Me.cobo_Gender)
ws1.Range("I" & LastRow).Value = (Me.txt_SignupAge)
ws1.Range("K" & LastRow).Value = (Me.txt_Phone)
ws1.Range("L" & LastRow).Value = (Me.txt_Email)
ws1.Range("M" & LastRow).Value = CDate(Me.txt_DPStart)
ws1.Range("N" & LastRow).Value = CDate(Me.txt_DCStart)
ws1.Range("O" & LastRow).Value = CDate(Me.txt_OCStart)
ws1.Range("P" & LastRow).Value = CDate(Me.txt_CTIStart)
ws1.Range("Q" & LastRow).Value = CDate(Me.txt_CTOStart)
ws2.Range("G" & LastRow2).Value = (Me.cobo_EntryType)
ws2.Range("H" & LastRow2).Value = (Me.txt_Height)
ws2.Range("I" & LastRow2).Value = (Me.txt_Weight)
ws2.Range("J" & LastRow2).Value = (Me.txt_Chest)
ws2.Range("K" & LastRow2).Value = (Me.txt_Hips)
ws2.Range("L" & LastRow2).Value = (Me.txt_Waist)
ws2.Range("M" & LastRow2).Value = (Me.txt_BicepL)
ws2.Range("N" & LastRow2).Value = (Me.txt_BicepR)
ws2.Range("O" & LastRow2).Value = (Me.txt_ThighL)
ws2.Range("P" & LastRow2).Value = (Me.txt_ThighR)
ws2.Range("Q" & LastRow2).Value = (Me.txt_CalfL)
ws2.Range("R" & LastRow2).Value = (Me.txt_CalfR)
Me.txt_Updated = ""
Me.txt_First = ""
Me.txt_Last = ""
Me.txt_Suffix = ""
Me.txt_Updated = ""
Me.txt_First = ""
Me.txt_Last = ""
Me.txt_Suffix = ""
Me.txt_DoB = ""
Me.cobo_Gender = ""
Me.txt_SignupAge = ""
Me.txt_Phone = ""
Me.txt_Email = ""
Me.txt_DPStart = ""
Me.txt_DCStart = ""
Me.txt_OCStart = ""
Me.txt_CTIStart = ""
Me.txt_CTOStart = ""
Me.cobo_EntryType = ""
Me.txt_Height = ""
Me.txt_Weight = ""
Me.txt_Chest = ""
Me.txt_Hips = ""
Me.txt_Waist = ""
Me.txt_BicepL = ""
Me.txt_BicepR = ""
Me.txt_ThighL = ""
Me.txt_ThighR = ""
Me.txt_CalfL = ""
Me.txt_CalfR = ""
End Sub