473,569 Members | 2,782 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 2797
"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
1458
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...
4
2222
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...
4
2895
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
4843
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...
2
8161
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...
9
2801
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...
1
4510
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...
3
6437
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...
1
2124
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...
0
7693
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...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
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...
0
6277
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...
1
5501
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...
0
5217
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...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1207
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.