Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-access > #10813

Recordsetclone edit problem

Newsgroups comp.databases.ms-access
Date 2015-06-12 09:01 -0700
Message-ID <ec3bf158-83e6-4675-8d5b-e410311c02fc@googlegroups.com> (permalink)
Subject Recordsetclone edit problem
From Patrick Finucane <patrickfinucanetx@gmail.com>

Show all headers | View raw


Access 2013.  I have a form/subform.  The Main form is unbound/the subform a datasheet.  In the datasheet I have a Yes/No field called Selected.  It is the only one that is modified.  I then click on a command button to process records that are Selected = True.  At the end of the process, I want to set Selected back to False.

When I press the Select button, the after Update even is 
  Me.Dirty = False
because of the error I get

  I will present some of my code.

    Dim rst As Recordset
    Set rst = Me.InvoiceCreditReverseDS.Form.RecordsetClone
    rst.FindFirst "Selected = True"
    If Not rst.NoMatch Then
       'here I process data and update other tables then I do some overkill

       'overkill start
       lngID = rst!AccountsID
       rst.Close
       Set rst = Me.InvoiceCreditReverseDS.Form.RecordsetClone
       rst.FindFirst "AccountsID = " & lngID
       
       'overkill end
       rst.Edit
       rst!Selected = False
       rst!Credit_Note = "Reversed. " & rst![Credit_Note]
       rst.Update
    end if


Originally I just did stuff from the rst.Edit line.  Then I went and did overkill and closed the recordset and reopened it, found the record again, and attempted to edit it.

Why?  Because I keep getting an Error 3197; The MS Access database engine stopped the process because you or another are attempting to change the same data....whether or not I do overkill.

I have scoured my code.  In no place while processing the data have I attempted to update rst. I have used rst fields to update other table fields.  The only place I have attempted to modify/update rst is where I have rst.Edit and that gives me the error.

When I had just rst.Edit (not proceeding lines to close and open it), I couldn't step past rst.Edit.  When Close and Reopen, it bombs out on rst.Edit but I can step thru it to the next line.  Totally weird.

Can you see anything I am doing wrong?




Back to comp.databases.ms-access | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Recordsetclone edit problem Patrick Finucane <patrickfinucanetx@gmail.com> - 2015-06-12 09:01 -0700
  Re: Recordsetclone edit problem "Phil" <phil@stantonfamily.co.uk> - 2015-06-12 18:33 +0100
    Re: Recordsetclone edit problem Patrick Finucane <patrickfinucanetx@gmail.com> - 2015-06-12 10:48 -0700
  Re: Recordsetclone edit problem Ulrich Möller <knobbi38@arcor.de> - 2015-06-12 20:18 +0200
    Re: Recordsetclone edit problem Patrick Finucane <patrickfinucanetx@gmail.com> - 2015-06-12 12:47 -0700
  Re: Recordsetclone edit problem "Ron Paii" <None@none.com> - 2015-06-12 15:35 -0500

csiph-web