GotoRecord?

  • Thread starter Thread starter Henro
  • Start date Start date
H

Henro

I have a form based on a table with 400 dates. I want the form, on opening,
to open on the date of today.

Users need the ability to browse to former or future dates so putting Date()
as a criterium in the query won't work.

I'm thinking along the lines of:

DoCmd.GoToRecord acDataForm, "Jouw FormulierNaam", (Datum = Date()) but I
onderstand from the helpfiles that this isn''t possible?

Suggestions?

TIA Henro
 
Henro said:
I have a form based on a table with 400 dates. I want the form, on
opening, to open on the date of today.

Users need the ability to browse to former or future dates so putting
Date() as a criterium in the query won't work.

I'm thinking along the lines of:

DoCmd.GoToRecord acDataForm, "Jouw FormulierNaam", (Datum = Date())
but I onderstand from the helpfiles that this isn''t possible?

Suggestions?

TIA Henro

You might put code like this in the form's Load event:

'---- start of code ----
Private Sub Form_Load()

Me.Recordset.FindFirst "Datum=Date()"

End Sub
'---- end of code ----

That will work for Access 2000 or later. Minor modifications would be
necessary for Access 97.
 
That was it, so simple I could have thought it up myself!
But then again, I seem to think that of every problem I encounter and
somebody else thinks up for me.

Hey, thanks a lot!

Henro
 
Back
Top