Hi All
I have a form that needs to have the date automatically entered depending on time, I have it set on form load and new record, so far I have this but if I change the time to test it doesn't work??
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
If Mytime <= 1500 Then
Me!PostDate = Date
Else
Me!PostDate = Date + 1
End If
End Sub
Private Sub Form_Timer()
Me.Mytime.Requery
End Sub
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
DoCmd.GoToRecord , , acNewRec
If Mytime <= 1500 Then
Me!PostDate = Date
Else
Me!PostDate = Date + 1
End If
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
I have a form that needs to have the date automatically entered depending on time, I have it set on form load and new record, so far I have this but if I change the time to test it doesn't work??
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
If Mytime <= 1500 Then
Me!PostDate = Date
Else
Me!PostDate = Date + 1
End If
End Sub
Private Sub Form_Timer()
Me.Mytime.Requery
End Sub
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
DoCmd.GoToRecord , , acNewRec
If Mytime <= 1500 Then
Me!PostDate = Date
Else
Me!PostDate = Date + 1
End If
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
Last edited: