How do I get a query supplied date into form not based on that query?

C

Clarabella

I'm going nuts here. I have a form with a sub form that are linked
properly. My subform has a date field that can have a bunch of
different dates. To get the most recent date I have a query that works.
I am trying to get the returned value from the query into my main form
so that the user immediately knows upon opening the form, when the last
entry was put into the subform. I don't know how to accomplish this and
would really appreciate some help. I don't know if I need to build the
expression in the table form which the from was created (when I open the
expression builder there I don't get the option of choosing other table
or queries and I find that a bit puzzling). Can anyone help?


--
Clarabella
------------------------------------------------------------------------
Clarabella's Profile: http://www.thecodecage.com/forumz/member.php?u=2201
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=207727

http://www.thecodecage.com/forumz


--- news://freenews.netfront.net/ - complaints: (e-mail address removed) ---
 
J

John W. Vinson

I'm going nuts here. I have a form with a sub form that are linked
properly. My subform has a date field that can have a bunch of
different dates. To get the most recent date I have a query that works.
I am trying to get the returned value from the query into my main form
so that the user immediately knows upon opening the form, when the last
entry was put into the subform. I don't know how to accomplish this and
would really appreciate some help. I don't know if I need to build the
expression in the table form which the from was created (when I open the
expression builder there I don't get the option of choosing other table
or queries and I find that a bit puzzling). Can anyone help?

Assuming that the table displayed on the subform is named MySubTable, you can
put a textbox named txtLatest on the subform's Header (or Footer, doesn't
matter) with a control source

=Max([datefield])

On the mainform, put another textbox with a control source

=[subformname]![txtLatest]

using the name of the Subfor Control (which might or might not be the name of
the form object within that control).

--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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