A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Warning on screen before i log users out



 
 
Thread Tools Display Modes
  #1  
Old July 7th, 2009, 04:42 PM posted to microsoft.public.access.forms
Deltic
external usenet poster
 
Posts: 19
Default Warning on screen before i log users out

I Currently have a button which i press to log users out of my system
when i wish to do any maintenance. This solution was fine when i set
up the database as there were only ever 1 or 2 user in it at a time
and i could advise them individually when the system required closing
down. Now the management has deceided to use my system over a larger
workgroup and telling them individually that i am closing down will
not be possible. I currently use the code below
Private Sub cmd_shutdown_Click()
txt_status.Value = 2
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

End Sub
What i would like to do is have a warning box appear which tells all
users logged in that maintenace will take place in two minutes and to
save their current work, after which i would gain unique control. I
also have another button which allows me to open the system back up,
(Code Below), which i would still like to use if possible.
Private Sub cmd_open_Click()
txt_status.Value = 1
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

End Sub

Is this possible?

Thanks in advance
  #2  
Old July 7th, 2009, 05:41 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Warning on screen before i log users out

First, get rid of the DoMenuItem code. it has long been obsolete and only
available for backward compatibility. And, it is impossible to read. I have
been developing in Access for over 10 years and I really don't know what your
code is really doing.

A few points. It appears that you have multiple people using the same mdb
file and that your database is not split. The most important thing you can
to right now, first, before anything else, is to correctly configure your
application.

There are a number of reasons. First, one of the main causes of database
corruption is multiple users sharing an mdb. If the data and application are
in the same mdb, you can loose your data and application objects. Then, there
is the issue of updating the database. When you have the data and
application in the same mdb, that become difficult, keeps users out when they
don't really need to be, reducing their productivity.

The correct configuration for an Access Application is:
Split the database. You can use the database splitter wizard to start with.
It will create two mdbs. One will contain all the forms, reports, modules,
queries, and macros. The other will contain tables, relationships, and
indexes. The mdb with the origninal name will contain the application
objects. It is know as the Fornt End (fe). The data mdb is known as the Back
End(be) and will have _be appended to the original name. For example, if
your orginal file name was MyGreatApp.mdb you will have MyGreatApp.mdb and
MyGreatApp_be.mdb.

MyGreatApp_be.mdb should be on a shared folder where your users have all
rights. They need read, write, create, and delete rights. The users will
have access to the data using Linked tables.

When the wizard splits the database, it creates a linked table in the fe. A
linked table is not a table, but just a reference to where the data actually
is. The wizard creates the link using the directory the orininal unsplit
file is and where you tell it to put the be file. You need to change this in
the fe database. The main issue is it using Drive Map references. For
example it might be M:\AccessData\MyGreatApp_be.mdb, but not all users will
have the same drive mapping, so it is better to use URL mapping for the link.
It is like \\MyServerName\AccessData\MyGreatApp_be.mdb.

Now you need to install a copy of the fe file on each user's computer.

As to sending the message to other users. This will take a bit of effort
and probably some redesign.

You will need a form that stays open all the time. It should be the first
form you open. It can be invisible. That form needs to have a timer that
will check the values in a table to see if there are any messages. The table
really needs only one row. I usually have a SystemAvailable field (Boolean)
that identifies whether the system is available. The load event of the form
checks that value when you open the app to see if it is okay to continue.
Then each time the timer fires, see if the system is still available and I
also use a field that contains the message and a field that contains the time
before the shutdown occurs.

You will need a small form to enter those values.

Now when a user sees the message, they can quit now or wait until it times
out and closes automatically.
--
Dave Hargis, Microsoft Access MVP


"Deltic" wrote:

I Currently have a button which i press to log users out of my system
when i wish to do any maintenance. This solution was fine when i set
up the database as there were only ever 1 or 2 user in it at a time
and i could advise them individually when the system required closing
down. Now the management has deceided to use my system over a larger
workgroup and telling them individually that i am closing down will
not be possible. I currently use the code below
Private Sub cmd_shutdown_Click()
txt_status.Value = 2
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

End Sub
What i would like to do is have a warning box appear which tells all
users logged in that maintenace will take place in two minutes and to
save their current work, after which i would gain unique control. I
also have another button which allows me to open the system back up,
(Code Below), which i would still like to use if possible.
Private Sub cmd_open_Click()
txt_status.Value = 1
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

End Sub

Is this possible?

Thanks in advance

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.