G
Guest
I have a form with a textbox. The format of the textbox is set to mm//dd/yyyy.
In the form's module, I want to set the default value of the textbox using the dateserial function:
Private Sub Form_Open(Cancel As Integer)
Me!Textbox.DefaultValue = DateSerial(Year(Now), Month(Now), Day(Now))
End Sub
This returns 12/30/1899 as the value in the text box. Does anyone see what the problem may be?
PS The reason I use the dateserial function here is that this is a simplification of my code, I will be using the dateserial to manipulate the date in the final code.
Thanks!
In the form's module, I want to set the default value of the textbox using the dateserial function:
Private Sub Form_Open(Cancel As Integer)
Me!Textbox.DefaultValue = DateSerial(Year(Now), Month(Now), Day(Now))
End Sub
This returns 12/30/1899 as the value in the text box. Does anyone see what the problem may be?
PS The reason I use the dateserial function here is that this is a simplification of my code, I will be using the dateserial to manipulate the date in the final code.
Thanks!