Solved

Access Query only Edit

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

707 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

17 Experts available now in Live!

Get 1:1 Help Now