Results 1 to 4 of 4
  1. #1
    honey2wood is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    25

    Get Subform Dates

    Hello to all,

    I have a form I am using to display an emloyees details with a subForm displaying dates that they have worked. The subform has a time from and to on each day.


    What I need to display on the main form is the first date in the subform and the last date. This is the main problem at the moment. After this I will need to work out the number of weeks between dates.
    I hope this makes sence.

    Graham

    Thanks for reading this.

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You cannot reference a particular record from the subform, but you can use the domain aggregate functions DMax() and DMin() to pull the data from the same record source that the subform uses.

    You will need to set up 2 unbound controls in the main form (one for each function)

    The DMax() would look something like this

    =DMax("datefield", "recordsourcename", "EmployeeIDfield=" employeeIDfieldintheMainForm)

  3. #3
    honey2wood is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    25

    Thumbs up

    Hi Jzwp11

    Thanks for getting back. That sounds so obvious now. I will try it but Ithink that will work.

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You're welcome. The syntax of the domain aggregate functions can be a little tricky, so please post back if you run into problems.

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

Similar Threads

  1. Replies: 5
    Last Post: 11-16-2011, 07:30 PM
  2. Replies: 10
    Last Post: 11-16-2011, 10:58 AM
  3. Replies: 7
    Last Post: 07-15-2011, 01:58 PM
  4. display all dates between two dates
    By KenThompson in forum Access
    Replies: 8
    Last Post: 02-23-2011, 01:11 PM
  5. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 PM

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