I've got a form that performs some vba on load. It does a datediff to see if the current date is less than 1 when compared to the current value of a textbox. If this value is indeed less than one, it asks the user via an input box when the next pay day is. However, upon doing so it populates the textbox with 12/30/1899? The property of the textbox is set to short date. What gives? Code is below and thanks in advance.
Dim daysRemaining As Single
Dim payDate As Date
Dim rs As Date
On Error Resume Next
payDate = Me.txtNextPayDay
daysRemaining = (DateDiff("n", Date$, payDate)) / 1440
If daysRemaining < 1 Then
rs = InputBox("Enter next pay date:")
Me.txtNextPayDay.DefaultValue = Format(rs, "Short Date")
End If
Dim daysRemaining As Single
Dim payDate As Date
Dim rs As Date
On Error Resume Next
payDate = Me.txtNextPayDay
daysRemaining = (DateDiff("n", Date$, payDate)) / 1440
If daysRemaining < 1 Then
rs = InputBox("Enter next pay date:")
Me.txtNextPayDay.DefaultValue = Format(rs, "Short Date")
End If