Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2008, 06:32 AM
Registered User
 
Join Date: Sep 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default msysobjects.DateCreate

I would like to be able to view the creationdate of at table im my Access database. Until recently this worked fine in my testdatabase, with an unbound txtBox on a form like this:
Rowsource:
Code:
SELECT msysobjects.DateCreate FROM msysobjects WHERE (((msysobjects.Name)="tblDummy") AND ((msysobjects.Type)=1));
But now I have split my database into a Backend (BE - only tables) and a frontend (FE - forms, queries, reports, VBA) with links to the BE-tables. This works fine with everything, except for the txtBox.
What would be the correct syntax to use for this?

I guess there might be a better way to do this. Is it possible to Write a sub that checks the creation date of the table and creates another table in my BE with this data? This new table (eg. tblDataCreated with only one tuple) could be linked to my frontend Ok.




\AccessFanatic
 
Old September 5th, 2008, 07:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Welcome to P2P! Without looking at it in depth, my first guess is that because your table is now LINKED instead of present inside the front end, the code is not finding the table.

Have you tried creating a table definition variable?

Dim db As Database, tdf As TableDefs, dtmCreated as Date

Set db = Application.CurrentDb
Set tdf = db.TableDefs
dtmCreated = tdf(0).DateCreated

Granted, I used table tdf(0)'s creation date, but if your desired table is tenth, tdf(9), then you'd have to find a way to know that tdf(9) is the one you want and not tdf(7), etc. You can loop until

tdf(x).Name = "DesiredTableName"

to get the correct creation date.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old September 5th, 2008, 01:45 PM
Registered User
 
Join Date: Sep 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi SerranoG

Thank you for your suggestion. I had figured out that the code wasn't finding the table, but could see no way to make it happen.
Will try your suggestion on monday. Will post back when I find out.



\AccessFanatic









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.