Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    GID is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2014
    Location
    USA
    Posts
    14

    Displaying Date Created and Date Modified on a Report

    How can I display the Date Created and Date Modified in a report (similar to Name and RecordSource)?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    The Date Created and the Date Modified of what? Are these fields in table?
    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
    GID is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2014
    Location
    USA
    Posts
    14
    The report itself (similar to Name and RecordSource).

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    If you want a field on the report, it should be in the recordsource of that report.

    Typically the report's recordsource is a table or query.

    see this M$oft link for more info.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Name and RecordSource are properties of the report object. Why would you want the report object date created and date modified?
    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.

  6. #6
    GID is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2014
    Location
    USA
    Posts
    14
    On a report, one can insert a text box that is "=[Name]" or one that is "=[RecordSource]". Both are standard in reports I create. What I am asking is whether there is a similar way to insert a text box that shows when the report was created or last modified.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    If you are talking about the report design, I think the MySysObjects table has this information. Can reveal system tables by right click on the Navigation pane bar > Navigation Options > Show System Objects. Could use DLookup() expression to pull the date values.

    If you are talking about when data that is being reported was originally input and when it was last edited, that is very different
    Last edited by June7; 11-28-2014 at 01:14 PM.
    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.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    GID,

    You can have a preliminary form with a dialog, and use the responses to add parameters to code to generate/publish a report.
    See Martin Green's material on Dynamic Reports.

  9. #9
    GID is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2014
    Location
    USA
    Posts
    14
    From the report, I tried this function passing along the Report Name, but I cannot get DLookup to find the right report. (Of course, since the same object could have the same name, I'd also have to limit the TYPE to -32764.)

    Function ReportLastUpdated(nam)
    ReportLastUpdated = DLookup("[DateUpdate]", "MsysObjects", "[NAME] = nam")
    End Function

  10. #10
    GID is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2014
    Location
    USA
    Posts
    14
    I meant to say "since more than one object could have the same name, I'd also have to limit the TYPE to -32764.)"

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Use as many criteria in the DLookup filter argument as you want.

    Don't put variables within quote marks. Concatenate variables.

    "[Name]='" & nam & "' AND [Type]=-32764"
    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.

  12. #12
    GID is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2014
    Location
    USA
    Posts
    14
    THANKS! I wouldn't have thought to use 'single quotes'.

    The final result that works:

    Function ReportLastUpdated(nam)
    ReportLastUpdated = DLookup("[DateUpdate]", "MsysObjects", "[Name]='" & nam & "' AND [Type]=-32764")
    End Function

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Text fields require apostrophe delimiters for parameters, date/time use #, nothing for numbers.

    I still don't understand why the date a report object was last modified is of value. This date has nothing to do with editing data.
    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.

  14. #14
    GID is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2014
    Location
    USA
    Posts
    14
    Thanks for your interest, but I do have a use for it as I maneuver through hundreds of reports in a database that was started in 1987 (before Access) to restructure reports that Access won't let me update more than 255 times.

    If one uses a report to create other reports -- and those to create even more -- eventually none of them can be updated when the magic 255 counter is reached. Heaven knows what some programmer years ago was thinking, but one has to ask, "Who is served by that?"

    BTW, I found this out the hard way when I programmed at a Federal Government agency years ago.

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    255 counter for what? A report cannot be edited more that 255 times? I am not aware of such a limit.
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. date modified in report
    By Rasha in forum Access
    Replies: 3
    Last Post: 04-26-2014, 09:47 AM
  2. Target Date Based on Created Date
    By mwong1782 in forum Access
    Replies: 1
    Last Post: 12-17-2013, 05:51 PM
  3. modified Date & Modified BY
    By bronson_mech in forum Queries
    Replies: 1
    Last Post: 12-06-2013, 10:45 AM
  4. Replies: 4
    Last Post: 03-06-2013, 02:32 PM
  5. Replies: 5
    Last Post: 12-18-2012, 02:37 PM

Tags for this Thread

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