Forbidden Access how to?

adi32

Registered User.
Local time
Today, 18:52
Joined
Dec 6, 2000
Messages
82
How can I make the users of an Access database to have every morning 1 hour to fill in a form and if they don’t to not have permission to continue using the db ?
 
What ? I think you want to allow users access for 1 hour a day

a) allow access between 9 am and 10 am
Simply check the system time on login ...
b) any user can have any 1 hour
Try looking into the on timer event...

Regards

The Mailman
 
no i want to obligate the users to fill in a form in 1 hour
and if they dont to not have permission to use the access database after that hour until they fill in that form
 
OK, but why not just log them into that form, and not let them out until it is filled out?
 
because its possible to have a very urgent gob and i want to give them 1 hour to work in other forms
 
Well then check out the On Timer Event of a form....

Read the help and anything on the forum about the "On Timer" event

Regards
 
OK, but do they have to fill this out each time they login? I mean when they login you could set a global variable with the login time, and check it in your form/s until the form is filled out. But what if they fill out this form, logout and then back in? Do they have to fill out the form again?
 
The most direct method I see for this involves a couple of steps. First, you need a startup form (could also be a switchboard) because the only way to run code reliably is to have a form around to support it. You will need to research the various ways to disable the options that let users bypass this form.

Next, you need a table that stores the data for each given user. The user information has to come from their network ID. That ID has been discussed at length in these forums. You should be able to find out about it with a good search.

The fields in this table must include a starting time for that first login for that first user. The other fields in the table have to be visible as well. The key/index to the table needs to be your user's network ID. I might also include a little something in your code that computes some number based on the content of the record. The code should be executable but not viewable in design mode. Include the computed number in the record.

Build the table, build the form, and build the startup or switchboard form. In the switchboard form, add a button that calls up the desired form. Also in the switchboard, write some OnCurrent or OnLoad code to test that table to see if a completed form exists on record for the current user. You will have three cases.

(1) No record at all or no record for today (really, the same case) - they will get the grace period but start a timer. See rest of the action below.

(2) Filled record - let them in.

(3) Record exists for today but is not complete - only show them the button on the switchboard to call up the form.

In case (1), where you are starting a grace period, immediately do two more things.

(4) set up a timer on the switchboard.

(5) Create a new, empty record for that user (based on the network ID) and close the recordset you used to create said record. (Note: If records exist for that user for prior days, delete them unless they contain important data for historical analysis.)

In the OnTimer routine for the switchboard, test the table for a valid record. If the table now has a complete, validated record, just erase the form's timer. If the table entry is still incomplete, I personally would flash up a Modal message box that said, "Your grace period has expired. Do you want to fill out the form now?" Then allow Yes and No as answers. If they pick YES then pop up the form as another Modal Dialogue box. If they pick NO, then force the application to QUIT.

OK, now I can't be accused of failing to answer your question. But here is my counter-comment. If you mean for them to do this every morning or not use the system, do it in absentia. If I did something like this to my users, they wouldn't bother with hanging me in effigy. To them, it would be a waste of a perfectly good effigy. They would more likely just start with the real thing. And that is a way that I don't want to use in order to get taller.
 
thank you very much

I have made this example
The user has 20 seconds to fill in the form with a new record
After this 20 seconds he cannot work with access until he fills the form

Of course someone professional its simple to bypass it
 

Attachments

Users who are viewing this thread

Back
Top Bottom