?
Solved

MS ACCESS 2010 Return Table Created Date to Form Test Box

Posted on 2013-06-26
2
Medium Priority
?
695 Views
Last Modified: 2013-06-26
Looking to get the Microsoft Access 2010 table created date/time to show up on a form in a textbox or label (don't which is best).

Objective
Display the Created Date for a table, "tmp_New_Items", on a form, "frm_New_Items", in a Textbox or Label.  

Steps Taken:

1.      Wrote the following function that works, now I need to get the results pushed to my form.

Public Function GetTableCreateDate(CreatedDate)

    CreateDate = CurrentDb.TableDefs("tmp_New_ITEMS").Properties("DateCreated")
    MsgBox CreateDate
     
End Function
2.      Added Text Box to form and updated the Control Source to “GetTableCreateDate(CreatedDate)”
3.      The Msgbox works… heee (We will remark that once working)
4.      Do I need to setup and run a Macro? (I’m not familiar with how)

Background:
When New Products are Ready to be imported we conduct a Make Table Query that creates the tmp_New_Items table with no problems.
0
Comment
Question by:REIHELPDESK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
als315 earned 800 total points
ID: 39280285
Look at sample. Your function should be liitle bit different:
Public Function GetTableCreateDate() As Date

    GetTableCreateDate = CurrentDb.TableDefs("tmp_New_ITEMS").Properties("DateCreated")
     
End Function

Open in new window

DBtblDate.accdb
0
 
LVL 21
ID: 39280290
You can  update your function to return the date  like this:
Public Function GetTableCreateDate(pTableName as String) as Date

    GetTableCreateDate= CurrentDb.TableDefs(pTableName).Properties("DateCreated")
        
End Function

Open in new window

Example usage in immediate window:
 ? GetTableCreateDate("tmp_New_ITEMS")

Open in new window


Set the control soucre to: =GetTableCreateDate("tmp_New_ITEMS")

Now the function can be used with any table by passing the table name to the function and it will return the Date Created.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question