Solved

Access Query only Edit

Posted on 2014-01-30
3
313 Views
Last Modified: 2014-01-30
Hi Experts,

I have a Query where i would like to allow the users to Edit the Records in the list. But prevent the users from Inserting new Records. Is that possible?
0
Comment
Question by:DCRAPACCESS
3 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39820380
That's not possible with a query.

However you can use a form and set its recordsource to that query, then set the following form properties:

AllowEdits:  Yes
AllowAdditions:  NO

And for a query like interface, set the default view of the form to Datasheet.


As a rule, you should always give users a form interface to view and edit data.  Never give them direct access to queries or tables.  A form interface gives you (the developer) much more control over what the user can or cannot do.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39820454
Assumptions:
User has no access to query modification.

One way:
Assume
table hh(hhid, hhdesc)  pk hhid
table hhh(hhid, hhhid, hhhdesc) compound pk hhid & hhhid

Database Tooks > Relationships:
hh(hhid)  1 -----> M hhh(hhid)

Set Referential integrity.

Query to release to users, removing part of compound key:
User is allowed only to modify existing records. If user tries to enter a new record, referential integrity won't allow it.

SELECT hhh.hhhid, hhh.hhhdesc
FROM hhh;

Open in new window

0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39820678
Just drag the query and drop it onto a new form in design view, and it will create a subform holding your query. In this, set AllowAdditions to False.

/gustav
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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

830 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