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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot write to record

Status
Not open for further replies.

xtraterrestrial

Programmer
Sep 23, 2003
38
0
0
CA
Hi,

I tried to write some information to a table by opening a recordset but I get the following error "Update or Cancel Update Without AddNew or Edit"
This is what a basically have,

Dim rs As DAO.Recordset
Dim db As DAO.Database

Set db = CurrentDb
Set rs = db.OpenRecordset("qryRole2")

rs!History = logEntry & rs!History

(logEntry is a String variable and i am trying to append to the history field)
Any help will be appreciated
 
I think you need to edit the record. Something like this:

Code:
rs.Edit

rs!History = logEntry & rs!History

rs.Update

The edit opens the current record for editing and the update amkes the changes to the record.
 
You must first open the recordset to edit the update to save the change like the code below.

rs.Edit
rs!History = logEntry & rs!History
rs.Update
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top