A
Antonio
I asked for help on VB code that would display a specific date for a form I
was workingwith. (Thanks Dirk!) It worked excellent. However, my customer
wants it to display the previous days date. Below is an example of the code
Dirk provided:
Private Sub Form_Load()
With Me.RecordsetClone
If .RecordCount > 0 Then
.FindFirst "[DutyDate] = Date()"
If .NoMatch Then
.MoveLast
End If
Me.Bookmark = .Bookmark
End If
End With
End Sub
Can anyone suggest how I could adjust the code so that when the form loads
it displays yesterdays date? I tried to insert the following but got an error
when I tried to debug:
If .RecordCount > 0 Then
.FindFirst "[DutyDate] = DateAdd("d',-1,Date())"
If .NoMatch Then
.MoveLast
Any help would be greatly appreciated.
was workingwith. (Thanks Dirk!) It worked excellent. However, my customer
wants it to display the previous days date. Below is an example of the code
Dirk provided:
Private Sub Form_Load()
With Me.RecordsetClone
If .RecordCount > 0 Then
.FindFirst "[DutyDate] = Date()"
If .NoMatch Then
.MoveLast
End If
Me.Bookmark = .Bookmark
End If
End With
End Sub
Can anyone suggest how I could adjust the code so that when the form loads
it displays yesterdays date? I tried to insert the following but got an error
when I tried to debug:
If .RecordCount > 0 Then
.FindFirst "[DutyDate] = DateAdd("d',-1,Date())"
If .NoMatch Then
.MoveLast
Any help would be greatly appreciated.