Open form for all users

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello.

I wonder if there is any way of making a form open for all users when I open
it?
To clarify, I open the form.
When I do that, I want it to open also for all other users that are
currently using the db.
I have a feeling that this wont work, but I thought it was worth a try to ask.

/Claes D
 
Claes,

I don't think it's possible directly, in the sense that each user's copy of
the front end is completely isolated from every other copy. You could do
something of the sort with a little trick, though: suppose there is a single
field, single record table in the back end, reflecting the status of the
form (open/closed). The field value is "closed" to begin with. When you open
the form, an update query run off the On Open event changes the field value
to "open", and, likewise, another update query sets it back to "closed" from
the form's On Close event.
Now, on every other user's front end, there is a timer on a form that is
constantly open (a switchboard, if one exists, or a dummy, hidden form just
for the purpose, in the absense of a switchboard), which checks periodically
(every 5 seconds?) the value of the field in the table, and opens the form
if the value is "open".
Will this do for you?

Curious to see if anybody's got a more elegant suggestion!

Nikos
 
Thank you Nikos.

The thought of a timer has crossed my mind.
But I didnt really know what to make of it, hehe.

I think this will work just fine.
Sounds like it neway.
I will try it later today, and see if it works.

To help others, I will explain the purpose of this.

A form opens for all users, and it asks them to close the new form, save
their changes and shut down the db.
If they are using the db, but not in their seat, a timer on the new form
will shut down Access by itself after a minute or so.
If they close the new form, they have to close Access themselves. (so they
have a chance to finish what they are doing)
If they closed the new form and never closed Access, it will reopen, since
it is on a timer (From the Switch-form), thus repeating the process.

Since I log all events when people log in or out, I will see when all people
are "kicked out" and I have the db all to myself, hehe.
The thing is, that I dont want to kick them out, without giving them a fare
warning first.

Hope this idea will help others that wants to "kick users"

/Claes D

"Nikos Yannacopoulos" skrev:
 
Thank you SOOOOOOO much Nikos.

It worked!!!
I have been thinking about this one for so long.
Now I can finally shut down all users whenever I want.

/Claes

"Nikos Yannacopoulos" skrev:
 
Glad to have helped!

Claes D said:
Thank you SOOOOOOO much Nikos.

It worked!!!
I have been thinking about this one for so long.
Now I can finally shut down all users whenever I want.

/Claes

"Nikos Yannacopoulos" skrev:
 
I made a new table with only one field. (True or false)
I then created a subform (made invisible) based on this new table, and put
it in my Switchboard.
Then I made 2 update querys.
1 to make true and 1 to make false.
On the Switchboard I put a timer to open another form that warns the user
that the DB soon will close.
This form only opens if field in subform=True
 
My only suggestion to that is that the new table also be in a separate
mdb. The times when I want everyone to get of is usually because of a
corrupt Tables mdb and if it is corrupt, I will not be able to get into
it to set the flag to force everyone off. Many times I have seen the
tables be corrupt so that noone new can get in but those that are in
can work (at least for a while).

By making it a linked table to a separate mdb you get around that
problem.

Depending on what you do when the application exits, this may or may
not help - Logging exit activity to a corrupt table will still stop you
so you have not helped yourself really, at least for those who are NOT
at their desk, but it will help the others.

Ron
 
Back
Top