Solved

Make a field in a query locked

Posted on 2013-02-06
7
342 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 51

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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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 48

Accepted Solution

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

Industry Leaders: 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!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

627 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