hi
I have this code , when I write the day of date in textbox then should complete the current month and current year but it shows this date 31/12/1899
so if I write 1 then should complete the date like this 01/06/2021
any suggestion to fix it ,please?
I have this code , when I write the day of date in textbox then should complete the current month and current year but it shows this date 31/12/1899
so if I write 1 then should complete the date like this 01/06/2021
VBA Code:
Private Sub TextBox1_Change()
Dim dDate As Date
dDate = DateSerial(Year(Date), Month(Date), Day(Date))
TextBox1.Value = Format(TextBox1.Value, "dd/mm/yyyy")
dDate = TextBox1.Value
End Sub