Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Make a field in a query locked

Posted on 2013-02-06
7
Medium Priority
?
364 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 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 52

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 1000 total points
ID: 38864806
why don't you try using a datasheet form?



.
0
 
LVL 49

Accepted Solution

by:
Dale Fye earned 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…
Suggested Courses

886 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