Show table Properties in a report

Poco_90

Registered User.
Local time
Today, 15:39
Joined
Jul 26, 2013
Messages
87
Hi,
I have a database created that imports data (stock levels) from a text file into a table and then email various suppliers with the current stock levels. The emails are all scheduled using scripts.

The weakest part of my set up is the text file, I am depending on someone remembering to run the report to create the text file, which cannot be automated.

I was thinking, if I could display the date the table was created in the report, I could add some disclaimer to make sure the created date equal report date. Is it possible to show the table properties date in a report? I searched but cannot find anything that matches my request.
TIA,
Poco
 
You can automate Reports in Access.. I do not see why it should be a problem..

However, Tables (as far as I know) do not have a DateCreated property.. But the Text file you are importing would have that info which you can use.. It depends how you use this import..
 
Hi Paul,
Thank you for your response.

I have a button in a form that a users clicks on to import the data. The date of the last import would suit my needs. Can the import date be displayed on a report?
Thanks.
 
Well I was wrong.. I actually looked in a little bit deep, apparently the Table have a property called DateCreated.. Which can be accessed as...
Code:
CurrentDb.TableDefs("[COLOR=RoyalBlue][B]yourTableName[/B][/COLOR]").DateCreated
You can use this.. In the Report create an Unbound TextBox in which you can set this as the Control Source..

Sorry if I have mislead in anyway..
 
Hi Paul,
Thanks for getting back to me. I tried as you suggested entering

CurrentDb.TableDefs("STDATA").DateCreated as the control source for an unbound text box, but when I view the report the box is blank and the code changes to CurrentDb.[TableDefs("STDATA")] when I look at its properties.

But you did point me in the right direction. I found this in another fourm

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

Thanks for your help.
Poco
 
Well Poco glad you have it sorted.. This might be a bit too late, but I should have mentioned it more clearly.. It should have been..
Code:
[COLOR=Red][B]= [/B][/COLOR]CurrentDb.TableDefs("STDATA").DateCreated
But using a function is a good option too..
 

Users who are viewing this thread

Back
Top Bottom