Displaying the result of a query when opening a form

simonc1978

New member
Local time
Today, 23:19
Joined
May 9, 2011
Messages
4
OK, here's hoping someone can help me out...

I have a form called Control Panel which opens up when I open my database. I also have a query called MaxDate which return the latest date from a table called tblSessions. How can I change the form so that it displays the result of the query MaxDate every time it is opened? I'd like it as just a little text field (label?) at the bottom of the Control Panel.

Thanks!
 
Presuming the query can't be the record source of the form, you could use a DLookup:

=DLookup("FieldName", "QueryName")

I'd actually eliminate the middle man (the query) and just do

=DMax("DateField", "TableName")
 
Presuming the query can't be the record source of the form, you could use a DLookup:

=DLookup("FieldName", "QueryName")

I'd actually eliminate the middle man (the query) and just do

=DMax("DateField", "TableName")

Thanks, I used the latter option... worked perfectly.
 
Happy to help, and welcome to the site by the way.
 

Users who are viewing this thread

Back
Top Bottom