Reputation: 2616
I have a form (datasheet mode) that has about 9 fields, and I only want 2 of them edited. The rest of the fields, I'd like to make it perfectly clear to users that they can't be edited, preferably by making it impossible to click on them. I've set the Locked property appropriately, and the Tab Stop so that if you tab through, you only get to the 2 fields that can be edited.
However, if you directly click on the fields that shouldn't be edited, you can still select and highlight them. It's just that when you try typing in them, it fails.
FYI - I'm using the data filters at the top of the datasheet form pretty heavily, so anything that caused that not to work wouldn't be something I could use.
I'm using Access 2013. Thanks for any tips!
Upvotes: 0
Views: 712
Reputation: 27644
The combination of Locked = Yes
and Enabled = No
makes controls unreachable (they cannot get the focus).
Note though that in some cases this may be impractical for the users: if they can't highlight the text, they can't copy it (to paste somewhere else).
If I don't want that, I usually give locked controls a grey background color (instead of white) to visualize that they can't be edited.
(Edit: but that doesn't work for a datasheet form with alternating row background colors.)
Upvotes: 2