Return value from "table property" (date when created)?

M

Mikael Lindqvist

Hi,

I guess this is fairly simple but I can't find any reference so here we go..

Question: In my report I would like to show the "DATE" when one of my tables
(in my database) was "created" (not last "changed")...

Does anyone know how I can achieve that?

Kindly,
Mikael
Sweden
 
A

Allen Browne

If it's a local table (not an attached one), this might work:
=CurrentDb.TableDefs("Table1").DateCreated

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
A

Allen Browne

If it's a local table (not an attached one), this might work:
=CurrentDb.TableDefs("Table1").DateCreated

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
M

Mikael Lindqvist

Nope, afraid that's not working (I changed the "Table1" to my specific table,
and when I try to generate the report I get popup asking for the "CurrentDB"..

So I changed that to the correct DB name, same thing again..

So it seems it doesn't "understand" the "CurrentDB" string..

Ideas?

Kindly,
Mikael
 
M

Mikael Lindqvist

Nope, afraid that's not working (I changed the "Table1" to my specific table,
and when I try to generate the report I get popup asking for the "CurrentDB"..

So I changed that to the correct DB name, same thing again..

So it seems it doesn't "understand" the "CurrentDB" string..

Ideas?

Kindly,
Mikael
 
A

Allen Browne

Add this to a standard module:

Public Function ShowDate(strTable As String) As Date
ShowDate = CurrentDb.TableDefs(strTable).DateCreated
End Function


Then set the control source of your text box to:
=ShowDate("Table1")
substituting your table name

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
 
A

Allen Browne

Add this to a standard module:

Public Function ShowDate(strTable As String) As Date
ShowDate = CurrentDb.TableDefs(strTable).DateCreated
End Function


Then set the control source of your text box to:
=ShowDate("Table1")
substituting your table name

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top