Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to VBA detect an Access Form is currently opened in Network environment?

Posted on 2013-11-04
3
Medium Priority
?
314 Views
Last Modified: 2013-11-04
Dear Expert,

Assuming Form A is a MainSwitchBoard, can anyone shed some lights how to detect if Form A is currently being opened in a Network environment with VBA codes?

The reason for such detection is my solution need to Append some data after the last person on the network quit the database.

Thanks in advance
0
Comment
Question by:kaysoo
[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
3 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 750 total points
ID: 39621265
not sure I understand completely, but you might add a table to your database, and record every time FormA is loaded and who loaded it.  There really is no other way to determine whether another user has opened a form or not.

Several of my applications track this for all forms, so that I can track the frequency with which each form is used.  It is easy enough to do, create a table with fields for FormName, UserId, dtOpened, dtClosed.

Then use the form Open event to write a new record to the table with FormName, UserID, and dtOpened.  Then use the form Close event to update dtClosed for that User/Form combination.  The down side of this is that if the user terminates the program abnormally, you may end up with a NULL in the dtClosed field.
0
 
LVL 58

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 750 total points
ID: 39621348
There's no way to do that directly.  You have to set some type of flag as Dale suggested and build that into the application.

As a suggestion, you can use the code here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_5328-Resource-locking-in-your-applications.html

 to do that type of thing.   You just need one table that all applications can see.

 Just ast the article suggests setting a lock for when a user enters/exits a database, you could do that for forms and reports as well, as Dale suggested.

Jim.
0
 

Author Closing Comment

by:kaysoo
ID: 39623308
Thanks everyone, I never thought of that, appreciate the suggestions.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

618 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