GoTo record

R

redwood911

Seemed simple but I cant get it to work

I have a form/ table with a row for each day of the month like a
calendar that when opened I want it to go to the current dates entry.
All dates are static so new rows aren't created- just updated/
edited...

I don't want to flter anything- just be on the entry for the day in
question when it opens and be able to navigate forward or backward...

[date] = Date()?
 
K

Ken Sheridan

Assuming the [Date] column is of date/time data type in the form's Open event
procedure put:

Dim rst As Object

Set rst = Me.Recordset.Clone

With rst
.FindFirst "[Date] = #" & Format(VBA.Date,"yyyy-mm-dd") & "#"
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

I'd advise against using Date as a column name however to avoid confusion
with the Date function.

Ken Sheridan
Stafford, England
 
Top