Computer Learning Zone CLZ Access Excel Word Windows

I don't want to believe. I want to know.

-Carl Sagan
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Templates > ABCD > Part 5 > < Part 4 | Part 6 >
Back to ABCD Core Part 5    Comments List
CreatedDate Upload Images   Link   Email  
Eduardo Benaim       
10 months ago
How do I read The Actual CreatedDate form a File in a Directoy?

IN ABCD Database there is this Statement

DoCmd.RunSQL "INSERT INTO DocumentT (EntityID, Filename, Description) " & _
"VALUES (" & EntityID & ", """ & NewFilename & """,""" & NewFilename & """)"

I modifiead it to Include CD which is the CreatedDate

DoCmd.RunSQL "INSERT INTO DocumentT (EntityID, Filename, Description, CreatedDate) " & _
"VALUES (" & EntityID & ", """ & NewFilename & """,""" & NewFilename & """,""" & CD & """)"

right now CD is the default value in the table now()

I need it to be the Actual CreatedDate in the Explorer.
How do I read the Attribute to Make CD the Actual File Creation Date?
Eduardo Benaim       
10 months ago
Set FD = Application.FileDialog(msoFileDialogFilePicker)
    With FD
        .InitialFileName = ABCDFolder
        .AllowMultiSelect = IIf(DocType = "BulkAdd", True, False)
        .Title = "Select a File"
        .Filters.Clear


.CreateDate
Eduardo Benaim       
10 months ago
Found The answer:

FileDateTime ( file_path )
Kevin Robertson            
10 months ago
When I tested the FileDateTime function it returned the Last Modified Date NOT the Created Date.

Here's a simple function for getting the Created Date:

Function ShowFileInfo(filespec) As Date

    Dim fso As Object, f As Object, D As Date
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFile(filespec)
    D = f.DateCreated
    ShowFileInfo = D
    
    Set fso = Nothing
    Set f = Nothing
    
End Function


Private Sub GetCreatedDate_Click()

    Dim createdDate As Date
    createdDate = ShowFileInfo("Your File Path")
        
    MsgBox "Created: " & createdDate

End Sub


Eduardo Benaim       
10 months ago
You are right. Thank you Kevin

This thread is now CLOSED. If you wish to comment, start a NEW discussion in ABCD Core Part 5.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/14/2024 8:13:50 AM. PLT: 1s
xxx