Solved

Access Query only Edit

Posted on 2014-01-30
3
312 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

776 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