Re: Cannot update DAO Recordset



Most likely "MyQuery" is not updateable. If you open MyQuery directly from
the database window, can you update it manually?

If not, you might get some help here:

http://www.allenbrowne.com/ser-61.html

"Linq Adams via AccessMonster.com" <u28780@uwe> wrote in message
news:885f65fec6e41@xxxxxx
Why won't this code update my recordset? I get Error 3027 "Cannot update.
Database or object is Read Only." Form is based on a query with 4 fields,
which in turn is based on a table with the same 4 fields. Both the form
and
the query can be edited.

Microsotf DAO 3.6 Object Library is set in references

*******************Code******************
Dim rs As DAO.Recordset

Set db = CurrentDb

Set rs = db.OpenRecordset("MyQuery")

Do While Not rs.EOF
rs.Edit
rs!MyCheckBox = -1
rs.Update
rs.MoveNext
Loop

rs.Close
Set rs = Nothing

*****************End Code****************

Running Access 2003/SP2, Windows XP

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200808/1



.



Relevant Pages

  • Re: QueryDef
    ... enough to evaluate when the query is opened from the database window. ... Dim db1 As Database ... Dim prm As Parameter ...
    (microsoft.public.access.formscoding)
  • Re: Timestamp
    ... In the database window, click the ... Tables or Queries tab, select the table or query, then Insert> Autoform. ... If the user opens it, ...
    (microsoft.public.access.formscoding)
  • Re: Microsoft Cleanliness
    ... In the database window they added a couple of wizards to clutter it up instead of. ... MS preceeds each table with the word TABLE and each query with "QUERY". ... Somebody at MS had common sense at one time and allowed you to select from Table, Query, or both in A97. ...
    (comp.databases.ms-access)
  • RE: Query update fails
    ... There's are several constants used here, one is for the query, which is used ... 'Otherwise update stat bar message and output query data to to Excel ... Kevin Backmann ... database window, updating the query and creating the pivot table and then ...
    (microsoft.public.access.modulesdaovba)
  • Re: Access to Tables
    ... directly into the query and edit the data there still ... I've implemented a switchboard startup form ... for them to use, disabled the database window so they can't find the tables, ... disabled the F11 key and the shift-bypass key, created a custom file menu, ...
    (microsoft.public.access.security)

Loading