Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Obtain Table Created Date in VBA

Discussion in 'Information Technology' started by Inquisitive1, Nov 11, 2005.

  1. Inquisitive1

    Inquisitive1
    Expand Collapse
    Guest

    Is there a way to store the created date for a table in a variable? I
    searched through the postings and the closest thing that I found was
    Currentproject.AllForms("frmYourFormHere").DateModified. I tried to
    use the currentproject., but that had everything except tables.

    I am still dabbling with VBA, so please let me know if I need to be
    more specific.

    Thanks!
     
  2. Loading...

    Similar Threads Forum Date
    Sikh Ebooks Obtained from Across the Internet History of Sikhism Oct 26, 2011
    Sikh Obtains Justice Hard Talk Dec 2, 2008
    Sikh News Sikh Obtains Justice: Court Finds CDCR Discriminated Against Bearded Prison Guard App Breaking News Dec 2, 2008
    Sikh News Punjab farmers told to obtain J-Forms from commission agents (New Kerala) Breaking News Sep 9, 2008
    When The Guru Instructs- Understanding Is Obtained Gurmat Vichaar Jan 31, 2008

  3. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    CurrentData is the object that contains the tables ...

    Public Sub ListTables()

    Dim aob As AccessObject
    For Each aob In CurrentData.AllTables
    If Left$(aob.Name, 4) <> "MSys" Then
    Debug.Print aob.Name, aob.DateCreated
    End If
    Next aob

    End Sub

    --
    Brendan Reynolds


    "Inquisitive1" <joseph.allison@delphi.com> wrote in message
    news:1131655471.300069.16870@g14g2000cwa.googlegroups.com...
    > Is there a way to store the created date for a table in a variable? I
    > searched through the postings and the closest thing that I found was
    > Currentproject.AllForms("frmYourFormHere").DateModified. I tried to
    > use the currentproject., but that had everything except tables.
    >
    > I am still dabbling with VBA, so please let me know if I need to be
    > more specific.
    >
    > Thanks!
    >
     
  4. Inquisitive1

    Inquisitive1
    Expand Collapse
    Guest

    Wow! That was quick!! Thank you very much!
     
  5. Inquisitive1

    Inquisitive1
    Expand Collapse
    Guest

    That doesn't seem to work. I manipulated your code at first, and got
    an error. So, I brought your entire code in and tried to run it, but I
    got the following error: Run-time error '438': Object doesn't support
    this property.

    Any suggestions?
     
  6. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    This isn't an ADP is it?

    --
    Brendan Reynolds

    "Inquisitive1" <joseph.allison@delphi.com> wrote in message
    news:1131657073.369831.65080@g49g2000cwa.googlegroups.com...
    > That doesn't seem to work. I manipulated your code at first, and got
    > an error. So, I brought your entire code in and tried to run it, but I
    > got the following error: Run-time error '438': Object doesn't support
    > this property.
    >
    > Any suggestions?
    >
     
  7. Inquisitive1

    Inquisitive1
    Expand Collapse
    Guest

    I think ADP must mean a front end? Yes, I am using Access 2000. I
    forgot to write that in my first thread.
     
  8. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    No, in Access 2000 and later you can create two types of Access file, MDB or
    ADP. If you're not sure which you have, you can find out by pressing Ctrl+G
    to go to the Immediate Window, typing ? CurrentProject.ProjectType and
    pressing enter. If the result displayed in the Immediate window is 1, you're
    using an ADP, if it is 2, you're using an MDB. The code I posted will work
    in an MDB, but apparently not in an ADP. In an ADP, the following SQL will
    list user tables and their created date ...

    SELECT name, crdate
    FROM dbo.sysobjects
    WHERE (xtype = 'u')

    --
    Brendan Reynolds

    "Inquisitive1" <joseph.allison@delphi.com> wrote in message
    news:1131719935.735735.47290@g49g2000cwa.googlegroups.com...
    >I think ADP must mean a front end? Yes, I am using Access 2000. I
    > forgot to write that in my first thread.
    >
     
  9. Inquisitive1

    Inquisitive1
    Expand Collapse
    Guest

    Okay. I checked and found that I am using an MDB (2 was returned from
    the immediate window). I stepped into the code and it doesn't like the
    line "Debug.Print aob.Name, aob.DateCreated". I hovered my mouse over
    aob.Name and I can see the table name. When I hover my mouse over
    aob.DateCreated, nothing appears. So, I am assuming that there is a
    problem with the aob.DateCreated. Do I need to add a specific
    reference for this to work?

    Thanks for your help!
     
  10. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    I'm afraid it is a mystery to me why the code would not work for you. But
    then I am using Access 2003. I'm at home now, and don't have access to a PC
    with Access 2000 installed - I'll try to test on Access 2000 when I get back
    to the office tomorrow.

    --
    Brendan Reynolds

    "Inquisitive1" <joseph.allison@delphi.com> wrote in message
    news:1132076153.460653.135460@g49g2000cwa.googlegroups.com...
    > Okay. I checked and found that I am using an MDB (2 was returned from
    > the immediate window). I stepped into the code and it doesn't like the
    > line "Debug.Print aob.Name, aob.DateCreated". I hovered my mouse over
    > aob.Name and I can see the table name. When I hover my mouse over
    > aob.DateCreated, nothing appears. So, I am assuming that there is a
    > problem with the aob.DateCreated. Do I need to add a specific
    > reference for this to work?
    >
    > Thanks for your help!
    >
     

Share This Page