Locking and disabling controls

M

Mike G.

Hello,

I would like to great an administrators form that would lock and disable
controls in an all users accessable form. Example; I have a set of records
that after all of the users have entered quarterly information I would like
to lock and disable the controls so they cannot go back and change the
information. I want to lock the controls after each quarter. I would like to
use the value set by a checkbox in an administrators form to control the
properties in the current form.

When I try using [sometable]![somefield]=yes i get a compile error "Can't
find project or library"

I am putting the code in Form_Current.

I've been away from Access for several years and my programming skill is
rusty.

Any help would be appreciated.
 
D

Douglas J. Steele

You can't refer to fields in tables in that way. If the field is in the
form's Recordset, you can use Me.somefield (even if it's not bound to a
control on the form). If it's not in the form's recordset, use the DLookup
function to retrieve the value from the table.
 
J

John W. Vinson

I would like to great an administrators form that would lock and disable
controls in an all users accessable form. Example; I have a set of records
that after all of the users have entered quarterly information I would like
to lock and disable the controls so they cannot go back and change the
information. I want to lock the controls after each quarter. I would like to
use the value set by a checkbox in an administrators form to control the
properties in the current form.

Well... you're crossing levels here.

A Form does not contain any data. A form is just a window; hopefully you don't
have one form for 2nd quarter 2007 data and a different form for 3rd quarter!

Your locking strategy would seem to be data-dependent, not form-dependent.

John W. Vinson [MVP]
 
M

Mike G.

Sorry about the empty reply box. Tried to reply on a very restrictive network.

The database has 3 levels of users. Gen. users, office and managers. (These
managers are not database admins) Managers have access to thier own set of
menu's and forms that most users do not. They are able to enter fixed
quarterly information, ex. days worked, scheduled hours, etc.

General users enter information for thier group at the end of each quarter.
They can see the information entered by managers but cannot change it. Once
final reporting for the quarter has been completed, the managers want to have
a check box on thier control form that once checked, it will disable and lock
specific controls on the general users form so quarterly data cannot be
changed.

Direct access to the database window, tables, queries, macros etc. is
restricted to only database administrators. Also new forms, queries, etc. can
only be made by database admins.

I hope thi makes it more clear.

I appreciate your time and helpful insight.
 
B

BrerGoose

(1) In the onOpen event, enable the check box only when the logged in user
is a manager account.

(2) In the onCurrent event, read the check box - if not-checked changed
AllowEdits to True, if checked change AllowEdits to False.

Alternatively, you could disable all the controls instead of changing
AllowEdits.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top