(Doc1 and Doc2 are both public in a module and chosen using a file selector)
I have this code below that lets users fill out textboxx25 if it is relevant to a user but it can be left blank. The text box is set up so that if the date is after 11/12/2020 then what is entered into the text box will go onto doc1 and doc2 will be left empty and vice versa if the date is before than. How could I set this up so that if it is left empty it will delete the entire row in the table?
The table looks like-
[textbox1] [textbox7] [textbox13] [textbox19] [textbox25] [textbox31]
Private Sub CommandButton1_Click()
Dim s As String
s = Me.TextBoxx25.Text
If s = "" Then
ElseIf DateDiff("d", s, Me.TextBoxx25.Text, "11/12/2020") > 0 Then
Doc1.Variables("TextBoxx25").Value = " "
Doc1.Variables("TextBoxx1").Value = " "
Doc1.Variables("TextBoxx7").Value = " "
Doc1.Variables("TextBoxx13").Value = " "
Doc1.Variables("TextBoxx19").Value = " "
Doc1.Variables("TextBoxx31").Value = " "
Doc2.Variables("TextBoxx25").Value = Me.TextBoxx25.Text
Doc2.Variables("TextBoxx1").Value = Me.TextBoxx1.Text
Doc2.Variables("TextBoxx7").Value = Me.TextBoxx7.Text
Doc2.Variables("TextBoxx13").Value = Me.TextBoxx13.Text
Doc2.Variables("TextBoxx19").Value = Me.TextBoxx19.Text
Doc2.Variables("TextBoxx31").Value = Me.TextBoxx31.Text
Else
Doc1.Variables("TextBoxx25").Value = Me.TextBoxx25.Text
Doc1.Variables("TextBoxx1").Value = Me.TextBoxx1.Text
Doc1.Variables("TextBoxx7").Value = Me.TextBoxx7.Text
Doc1.Variables("TextBoxx13").Value = Me.TextBoxx13.Text
Doc1.Variables("TextBoxx19").Value = Me.TextBoxx19.Text
Doc1.Variables("TextBoxx31").Value = Me.TextBoxx31.Text
Doc2.Variables("TextBoxx25").Value = " "
Doc2.Variables("TextBoxx1").Value = " "
Doc2.Variables("TextBoxx7").Value = " "
Doc2.Variables("TextBoxx13").Value = " "
Doc2.Variables("TextBoxx19").Value = " "
Doc2.Variables("TextBoxx31").Value = " "
End If
Doc1.Range.Fields.Update
Doc2.Range.Fields.Update
End Sub
'Thanks in advance!