Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
You could disable them (Enabled = No, I think) in the properties for the
control (text box, etc.). If that doesn't do it, provide details of your
situation.
 
Lynn there are several possibilties :
A. enabled property - ctlNamed.enabled = false
B. visible property -ctlnamed.visible = false
C. on got focus event --> redirect to other control every time the control
got focus .
 
We have multiple users of a form. We use it for dispatching trucks. I enter
the data in a new form to let the other branches know that a dispatch has
been generated for their location. Once the dispatch has been completed, the
other branches fill in their portion of the dispatch. What I would like to do
is protect the fields I have entered the dispatch data in. I guess what I am
trying to do is not allow edits for the fields I am resonsible for in the
form. I know you can select no edits for the whole form under properties. I
just want edits in specified fields.

Hope this clarifies my situation more

Thanks
 
Setting Enabled = False means the field is greyed out and hard to read.
Setting Visible = False means the field will not be seen on the form.
I don't think either of these is what she wants. I'm sure the people at the
branches need to see but not be able to edit the dispatch fields.

The simplest solution would be to set the dispatch controls on the form to
Locked = True for the Branch version of the form. The problem here is that
now you have 2 versions of the same form to maintain.

A better way would be to have some code in the Open event of the form that
could determine location of the front end database and set the controls
accordingly. Even better would be to implement Access security, then you
could determine who the user is and only allow certain users to access the
dispatch data.
 
My initial reply was brief because the question was so general. I agree that
locking the control would leave it easier to read than disabling it, but in
either case another option would be code in the form's Current event along
the lines of:

If Me.NewRecord Then
Me.DispatchControl.Locked = False
Else
Me.DispatchControl.Locked = True
End If

There should probably be a way of editing the original record if need be.
Sometimes I will set a label's double click event to unlock a control (or
whatever is needed). It depends on whether the point of locking the controls
is to guard against casual or accidental changes, or if the security needs go
deeper than that.
 
Back
Top