Results 1 to 5 of 5
  1. #1
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65

    Datestamping Design Mods

    I know how to datestamp a report when it is run (using the Now() function) but I also want to show which version of a report (or form) has been used. To do this I want to use the "modified" field that appears in the main database window and in the report or form properties.

    I tried using this to populate a text box called 'RevisedDate'
    Code:
        Dim strFDate As String
        strFDate = "20/Dec/2012"                  ' this works fine
    '    strFDate = Me.Properties.Modified       ' this doesn't work
    
        Me.RevisedDate.Caption = "Format revised: " & strFDate
    The hard-code version works fine but I can't figure out the syntaxt for the second version.


    Is there a way to capture these properties?

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    roaftech -

    You could search Access Help or the Access VBA Reference or just Google the "DateModified Property".

    Hope this gets you started.

    Jim

  3. #3
    A S MANN is offline Advanced System Analyst
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    India
    Posts
    163
    Try
    Dim strFDate As String
    strFDate = "20/Dec/2012" ' this works fine
    strFDate = Me.Modified.Value
    Me.RevisedDate.Caption = "Format revised: " & strFDate

  4. #4
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65
    Thanks Guys.
    I have explored the various resources as suggested and also tried the 'Modified' option.

    I inserted a mini-routine to test the syntax, derived from the Access help files:
    Code:
        With Me
            Debug.Print .Name & " " & .DateModified
        End With
    I tried several variations such as 'modified', 'modified.value', etc and the most promising seems to be as shown above. I use the old trick of typing all my code in lower case and allowing the interpreter to captialise the keywords that it recognises; 'datemodified' was duly recognised.

    However, everytime I run this code I get the "Method or data member not found" error message. If I put a comment marker in front of the first '&' the immediate window shows the filename as expected. Since 'DateModified' is a native keyword, ie no declaration required, why is this happening?
    I have some recollection from twenty years ago about linked libraries but I have looked at that and it seems ok.

    Any ideas?

  5. #5
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65

    Arrow

    Further to previous response, I dumped the whole example code from
    http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx
    Code:
    Dim acobjLoop As AccessObject  
    For Each acobjLoop In CurrentProject.AllReports     
       With acobjLoop         
          Debug.Print .Name & " - Created " & .DateCreated & " - Modified " & .DateModified     
       End With 
    Next acobjLoop
    into my code and it all worked at expected, including correctly reporting the latest modification to the report which runs the code.
    This rules out any library problems and any problem with getting file data from within the same file.

    Still puzzled!

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

Similar Threads

  1. Design help
    By Newby in forum Access
    Replies: 2
    Last Post: 12-31-2012, 07:21 AM
  2. Table Design -- want to avoid a design that creates blank fields
    By snowboarder234 in forum Database Design
    Replies: 4
    Last Post: 10-08-2012, 10:13 AM
  3. New guy needs help with some design
    By lpkorn423 in forum Database Design
    Replies: 2
    Last Post: 07-22-2012, 07:16 AM
  4. Design Help
    By jbevans in forum Database Design
    Replies: 3
    Last Post: 11-29-2011, 08:01 AM
  5. Help with Design
    By rbiggs in forum Database Design
    Replies: 8
    Last Post: 07-10-2011, 07:13 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