GotoRecord?

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
 
D

Dirk Goldgar

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.
 
H

Henro

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
 

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

Top