GoTo record

  • Thread starter Thread starter redwood911
  • Start date Start date
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()?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top