[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Access VBA - Form last run

Posted on 2014-07-11
Medium Priority
Last Modified: 2014-07-14
I have a MDB where it is important users do not re-run a db twice as there are append queries

Can i have a piece of code that displays the last time the form was ran as the form opens

So i have a form that opens as the DB opens, i would like a msgbox to pop up displaying the last time the button on the form was executed

Many thanks
Question by:Seamus2626
LVL 17

Accepted Solution

Barry Cunney earned 2000 total points
ID: 40190881
Hi Seamus
One idea may be to create a new table in your Database application named tbl_SystemActions.
This table could have 2 fields: Action and ActionDate.

Add an extra piece of code behind the click event of the button in question - e.g.
DoCmd.RunSQL "insert into tbl_SystemActions VALUES ('OrderButtonClicked','" & Date() & "')"

You could then read back from the tbl_SystemActions table OnFormLoad and display the latest Action date/time for the Action in question.

The advantage of having such a tbl_SystemActions table is that if in the future you wished to record details of other actions taken by users in the system or events occurring in the system itself

Author Comment

ID: 40194416
Thats a great idea Barry, il set that table up and query from there

Many thanks

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

834 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