Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateCreated()

Status
Not open for further replies.

milte

Technical User
Jan 30, 2002
20
US
Hello All,

On my switchboard, I'd like to have a textbox that would give the date of the last update to the database (which is monthly). I need the datecreated date for a table shown in this textbox. The table name is tblUMD. Is this possible?

Milt
 
Hi,

Tools->Options->View tab-> tick 'System Objects' ON to view the system tables.

Look at the MsysObjects table, date created of all objects is in there.

Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
there are 2 date fields in the MSysObjects table, one for DateCreated and one for DateModified. You can access the data from there, or you can use code to get the data from the TableDefs Collection. Personally I think the query is easier.

PaulF
 
Thanks for the reply, Darrylle and Paul. What code would I put in the text box to retrieve the info?

Milt
 
in the Switchboards On Open Event add this as an Event Procedure

Dim db as DAO.Database, rst as DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("MSysObjects")
With rst
.FindFirst("Name = 'tblUMD'")
YourTextBoxName = rst!DateCreated
End With
Set db = Nothing
Set rst = Nothing

PaulF
 
Thanks Paul.

I'm getting a runtime error 3251, Operation is not supported for this type of object. I debug and the

.FindFirst ("Name = 'tblUMD'") statement is highlighted.

Any ideas?

Milt
 
change

Set rst = db.OpenRecordset("MSysObjects")
to
Set rst = db.OpenRecordset("MSysObjects",dbOpenDynaset)

PaulF
 
Okay, I've got a little further. Next error is 'item not found in this collection' and the statement highlighted is: txtDate = rst!DateCreated txtDate is the name of my textbox.
 
sorry, the Field name is DateCreate not DateCreated

PaulF
 
Thanks Paul, I'm in business. I would have thought it'd be DateCreated.

Anyway, I appreciate your follow through to resolve this issue.

Milt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top