Solved

Make a field in a query locked

Posted on 2013-02-06
7
330 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
7 Comments
 
LVL 119

Expert Comment

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

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

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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 119

Assisted Solution

by:Rey Obrero
Rey Obrero 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 119

Expert Comment

by:Rey Obrero
ID: 38866660
;-)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now