Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

How can I display "last sale date" in a Text Box on a Form ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mthornblad@gmail.com - 24 Jul 2007 06:49 GMT
Hi

I have a Products table and a Sales Detail table that have a
relationship based on the Product Number.  The Products table has the
Product Number, description, etc..  The Sales Detail table has the
Product Number, qty, price, and Sale Date.

I have a form where I enter a Product Number.  I want to have a text
box that displays the "Last Sale Date".  That is, the latest date in
the Sales Detail table with the Product Number I enter on the form.

Please let me know how to do this.

Thanks in advance
Mark
Allen Browne - 24 Jul 2007 07:03 GMT
Put something like this in the Control Source of the text box on your form.
(It's one line.)
   =DMax("Sale Date", "Sales Detail",
       "[Product Number] = " & Nz([Product Number],0))

If Product Number is actually a text field, you need more quotes. It's the
same as for DLookup(), explained here:
   http://allenbrowne.com/casu-07.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I have a Products table and a Sales Detail table that have a
> relationship based on the Product Number.  The Products table has the
[quoted text clipped - 9 lines]
> Thanks in advance
> Mark
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.