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

  • Thread starter Thread starter Mikael Lindqvist
  • Start date Start date
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
 
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]...
 
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]...
 
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
 
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
 
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
 
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
 
Back
Top