473,888 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Have form only open for one user at a time.

My application is split into a front end and back end. Each user has their
own copy of the front end.

There are a few forms I only want to be open for one user at a time. So I've
implemented the following strategy:

1) Create a table with the fields FormName, OpenStatus, FormUser
2) When a user tries to open the form, the code in the Form Load event checks
the table for the OpenStatus value (True/False).
3) If the status is True, then someone else has the form open on another
machine and this user cannot open the form. A BypassCloseFlag is set and then
DoCmd.Close for the form is executed. The BypassCloseFlag prevents execution
of the code in step 5 below.
4) If the status is False, then the table record is updated to FormUser =
CurrentUser ande OpenStatus to True.
5) In the Form Close event, there is code to set OpenStatus to False and
FormUser to spaces as long as ByPassCloseFlag is not set to true.

This is all working fine, but I have the following concern.

What if the system crashes while this form is open and the user cannot close
it in a normal fashion which sets the table field for OpenStatus to False.
Subsequently, isn't there the potential that OpenStatus could remain set to
True with no one being able to open the form at all.

My users do not have any direct access to tables because I have locked down
the app using the startup options. Also, no user has direct access to the
backend file so it can't be opened.

Someone might suggest try it and see what happens. However, I don't wnat to
crash my system on purpose for testing. I might try it after I've implemented
something that I've been reasonably assured will work. But crashing the
system on purpose makes me nervous.

I guess I could include a form for the administrators to be able to reset the
OpenStatus to false for all form names in the table, but I wanted to see if
someone else has a suggestion.

Thanks.

--
Message posted via http://www.accessmonster.com
Mar 12 '06 #1
3 2829
"rdemyan via AccessMonster.c om" <u6836@uwe> wrote in
news:5d2a41035f 7cc@uwe:
My application is split into a front end and back end. Each
user has their own copy of the front end.

There are a few forms I only want to be open for one user at a
time. So I've implemented the following strategy:
WHY????????
Access is very good at handling concurrent users. Access also
supports exclusive mode.

1) Create a table with the fields FormName, OpenStatus,
FormUser 2) When a user tries to open the form, the code in
the Form Load event checks the table for the OpenStatus value
(True/False). 3) If the status is True, then someone else has
the form open on another machine and this user cannot open the
form. A BypassCloseFlag is set and then DoCmd.Close for the
form is executed. The BypassCloseFlag prevents execution of
the code in step 5 below. 4) If the status is False, then the
table record is updated to FormUser = CurrentUser ande
OpenStatus to True. 5) In the Form Close event, there is code
to set OpenStatus to False and FormUser to spaces as long as
ByPassCloseFlag is not set to true.

This is all working fine, but I have the following concern.

What if the system crashes while this form is open and the
user cannot close it in a normal fashion which sets the table
field for OpenStatus to False. Subsequently, isn't there the
potential that OpenStatus could remain set to True with no one
being able to open the form at all.
Right.

My users do not have any direct access to tables because I
have locked down the app using the startup options. Also, no
user has direct access to the backend file so it can't be
opened.

Someone might suggest try it and see what happens. However, I
don't wnat to crash my system on purpose for testing. I might
try it after I've implemented something that I've been
reasonably assured will work. But crashing the system on
purpose makes me nervous.
It should make you nervous. but you could test on a copy of BE
and copy of FE and just kill Access using the task manager.

I guess I could include a form for the administrators to be
able to reset the OpenStatus to false for all form names in
the table, but I wanted to see if someone else has a
suggestion.
Yes. Create a macro that resets the flag. You can then start the
application using the command line to run the macro.


Thanks.


--
Bob Quintal

PA is y I've altered my email address.
Mar 13 '06 #2
You should have a form for admin reset.

You should also include a date/time field
so that you can see when the record was last
set.

You may also wish to include a computer name field,
so that you can see which workstation the user
is/was at.

You can also use ADO to check the user roster to
see if the user who has the form locked is still
connected, but that will have the same failing:

If the user crashes without disconnecting, the
user roster maintained by Jet will have the same
error as you do.
"rdemyan via AccessMonster.c om" <u6836@uwe> wrote in message
news:5d2a41035f 7cc@uwe...
My application is split into a front end and back end. Each user has their
own copy of the front end.

There are a few forms I only want to be open for one user at a time. So
I've
implemented the following strategy:

1) Create a table with the fields FormName, OpenStatus, FormUser
2) When a user tries to open the form, the code in the Form Load event
checks
the table for the OpenStatus value (True/False).
3) If the status is True, then someone else has the form open on another
machine and this user cannot open the form. A BypassCloseFlag is set and
then
DoCmd.Close for the form is executed. The BypassCloseFlag prevents
execution
of the code in step 5 below.
4) If the status is False, then the table record is updated to FormUser =
CurrentUser ande OpenStatus to True.
5) In the Form Close event, there is code to set OpenStatus to False and
FormUser to spaces as long as ByPassCloseFlag is not set to true.

This is all working fine, but I have the following concern.

What if the system crashes while this form is open and the user cannot
close
it in a normal fashion which sets the table field for OpenStatus to False.
Subsequently, isn't there the potential that OpenStatus could remain set
to
True with no one being able to open the form at all.

My users do not have any direct access to tables because I have locked
down
the app using the startup options. Also, no user has direct access to the
backend file so it can't be opened.

Someone might suggest try it and see what happens. However, I don't wnat
to
crash my system on purpose for testing. I might try it after I've
implemented
something that I've been reasonably assured will work. But crashing the
system on purpose makes me nervous.

I guess I could include a form for the administrators to be able to reset
the
OpenStatus to false for all form names in the table, but I wanted to see
if
someone else has a suggestion.

Thanks.

--
Message posted via http://www.accessmonster.com

Mar 13 '06 #3
there's always a risk when you are using a semiphore to control access
to an object that if it crashes you'll be left with it in a permamently
locked state. The only full solution is to establish proper client
server communication - not easy to replicate with Access FE / BE.

The way I see it, you have 2 real options
1. Create an admin panel and give one user re-setting abilities
2. Look at your DB design - you should not have to lock users out of a
form for exclusive editing... Access can handle concurrent updates
quite well and there is probably a more workable design that can be
employed. (unless you're taking orders from one of those control freak
user clients that don't know what they are talking about - man I hate
that sh!t!!!)

Mar 13 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1471
by: strong | last post by:
may you help me?? thanks!! I want to establish a environment to server multi-user in win2000 I run a cgi-multithread-server program,its name is cgisrv.py and I write two programs to test it, one is named as test.py,another is result.py test.py : it has a form and a submit button,submit to result.py, it's just a html page result.py : use time.sleep(10) to wait 10 seconds,show the time before it and after it IN WINDOW98 AND LINUX :a. I...
4
2245
by: Raposa Velha | last post by:
So, chosen the interface for my app, finally I got stuck with transactions. Boy!, how many ways of doing the same job are there?! Any suggestion so I could find myself in the right direction? Pasting some code would be appreciated. My goal is updating several tables and rollback if any of the updates fail. Not much, hmm? I've seen in this NG may discussions (I even gave a try on the MS Access help, what a loss of time!!!) but couldn't...
4
2923
by: Pierre | last post by:
Hi all, To ease load on a network i close automatically form open with a timer reset by user actions. If the time is expired i go through the collections of form and table and close all those that are open. I choose this way to avoid putting code in each form, plus i can close all open table if any
14
4873
by: Mac via DotNetMonster.com | last post by:
Hi all, As some of you would know from my previous posts that I am rewriting our Unix based system into .Net with a MDI interface. Recently I have added a tab control to the top of the MDI parent form that will contain a tab page for each open MDI child form. It is only 24 pixels high so all you see is the tabstrip. Then I only have to add a bit of code to the "changed index" event of the tab control as well as the "on activate" event...
2
8187
by: Robert | last post by:
I am trying to give the user dynamic search capabilities to select almost any record in the database from criteria they select. Everything seems to work except when I open the display form to display the data to the user. If that form is already open, how do I make it refresh its data source and display the new data. Here is what I am doing. >From a text entry form, I create an SQL query dymanically and alter the sql statement of an...
9
2829
by: cendrizzi | last post by:
Hi all, I've read some stuff on this but can't seem to come up with a solution that works right. I have a semi-mature (yet very large and robust) internal web application that currently only works with one window open at a time. Maybe I'm abusing the use of $_SESSION but I have data entry processes split up in several steps (which is required since depending on what was put before determines what pages will be shown after). To store...
1
4526
by: mchlle | last post by:
I need for a form to display certain records based on the user. If current user = user1 or user2 then open frmNotesAll If current user = user 3 then open frmNotes where counselor id = 2 or 6 or 9 or user3 ID If current user = user 4 then open frmNotes where counselor id = 1 or 3 or 8 or user4 ID If current user = user 5 then open frmNotes where counselor id = 4 or 5 or 7 or user5 ID If current user = user6 or user7 or user8 then close...
3
6470
by: vidhyapriya | last post by:
Hi all I am developing windows application using vb.net.I want to pass values to open form.I am opening only one form when user click the buttons several times.Useing delegate i am passing values for first time.Next time when user click the button i want to pass value to open form.How to pass value to open form.Can anyone help me plz.Thanx in advance Code I used, Form1 Code: Public Delegate Sub GreetingDelegate(ByVal MsgString As...
1
2132
by: Nagel Oxles | last post by:
My form has has seven Text Boxes to receive user input. Users fall into either of two categories, Current and New. 'Command_Button_New' changes the visible property of four text Boxes and their Labels from False to True and 'Command_Button_Current' changes the visibility from True to False. I want the Form to open with three Text Boxes in view ready for current user input. New users should select 'Command_Button_New' to display the...
0
9961
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11185
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10439
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9597
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7990
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7148
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4642
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4247
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.