Results 1 to 3 of 3
  1. #1
    rnh is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2012
    Posts
    2

    Generating the "last work date" to fill in "completion date" field

    I'm creating a projects database, and it will have linked sub-tables for "Work Entry" and "Expenses Entry". Each "Work Entry" will have a field of "workdate", which will be entered for every date work is done on the project. I was wondering if I could create an expression such that when a Yes/No field called "Completed" is set to Yes, the date of the last entry for that project's "Workdate" field would be automatically used to fill a "Date Completed" field or perhaps a form or report.



    I'm totally new to Access, used a couple other dBase-style programs (including Alpha4) years ago ... I knew how to do something like this with A4, but in playing around for a while and reading quite a few things in help and on the web, I'm darned if I can figure this one out ... any help would be appreciated.

    Neil

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    One way is with DMax - a domain aggregate function (DLookup, DSum, DCount, etc).

    An expression in query or textbox ControlSource could be something like (assuming ProjectID is a number):

    IIf([Completed]=Yes,DMax("Workdate","tablename","ProjectID=" & [ProjectID]),Null)

    Access Help has more guidance on domain aggregate functions or Google for info.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rnh is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2012
    Posts
    2
    Thanks ...

    Neil

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  2. Date Query - Using "Between" and "AND"
    By GAccess in forum Queries
    Replies: 1
    Last Post: 06-06-2012, 09:58 AM
  3. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  4. Replies: 4
    Last Post: 03-14-2012, 09:05 AM
  5. Replies: 16
    Last Post: 07-22-2011, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums