Solved

Make a field in a query locked

Posted on 2013-02-06
7
336 Views
Last Modified: 2013-02-07
I have a query that runs in datasheet view and the user can edit the data.  Is there a way to lock certain fields so they cannot be edited?  I'm using the datasheet view and not a form since it's more familiar to the user.

Also, in the query result, does the field properties follow the table it's based on. ie...if the table that the query is based on is a combo box, will the query also display this field as a combo box.  It seems to work in most situations but there is one field that does not follow this logic.
0
Comment
Question by:actolex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38862455
you can only lock certain fields using Form

you will set the form's control Locked property to Yes
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 38863023
> Is there a way to lock certain fields so they cannot be edited?

Yes, set the controls using the fields to locked.

> .. if the table that the query is based on is a combo box, will the query also
> display this field as a combo box

Yes, the query will inherit the settings from the table. However, if you later change the table, the changes will not be reflected in the query.
One option is to recreate the query; another is to make the changes manually in the query.

/gustav
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38864587
actolex :
<I'm using the datasheet view and not a form since it's more familiar to the user.>

capricorn1:
<you can only lock certain fields using Form
you will set the form's control Locked property to Yes >

To be clear, you can set the form's default view as "Datasheet"
Then in addition to setting the Locked property of your Control to Yes,
you can also set the enabled Property to No. (This will not even allow them to click into the control)

Sample attached (Note that the "Category" field is Locked (cannot be edited))
... and Disabled (you cannot even click in the control)

JeffCoachman
Database88.mdb
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:actolex
ID: 38864796
Thanks....I've done with in forms before but they will only show one record unlike the datasheet view.
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 250 total points
ID: 38864806
why don't you try using a datasheet form?



.
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
ID: 38865557
actolex,

Close your query (save it), then select it in the navigation pane.

Then go to the ribbon, select Create, then in the Forms area, expand More Forms, and select the Datasheet.  datashee formThis will create a datasheet form based on your query.  From there, you can select the control you want to lock and set it's "Locked" property to Yes.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38866660
;-)
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question