Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Query so records can't be updated. 1

Status
Not open for further replies.

iowabuckmaster

Technical User
May 21, 2003
36
US

I am thinking maybe this can't be done.
I have a single table query that when it is run, I want the data to be non-updatable. I have searched and can't find where you can do this. I saw where people had queries not be able to update when they wanted to be able to update. I have went through the query properties and web help.

Any suggestions???
 
You can't update a query if it is grouped.

So, you can update this:

SELECT PartMaster.PartID, PartMaster.Discription
FROM PartMaster;

but you cant update this:

SELECT PartMaster.PartID, PartMaster.Discription
FROM PartMaster
GROUP BY PartMaster.PartID, PartMaster.Discription;

ChaZ


Ascii dumb question, get a dumb Ansi
 
Thanks Blorf. I did this, not sure how efficient it is but...

I went to the query design and clicked on the Totals button. Which put a Group By row agross my fields. I didn't use the row as far as summing or averaging.

Ran the query and tried to change a record and message says recordset is not updateable. So it worked.

"I'm just glad I had my bow in hand, from the time I saw him till he was down was about 45 seconds!" Nov. 1st 157 7/8 Typ
 
Selecting totals does the same thing.

Glad it worked.

Ascii dumb question, get a dumb Ansi
 
If you are opening the query via a macro or VBA, you can set it to be "Read Only" (check the parameters for the OpenQuery action).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top