Results 1 to 3 of 3
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185

    Run time error

    Hi Guy's i am not sure where my issue is here, i am getting run time error 3020 Update Or CancelUpdate Without AddNew Or Edit

    I have done this method several times but can't see the wood for the trees

    rs5 is set as DAO.Recordset
    stDN is set as string
    stDN = "Send To Delivery Note"
    i know there is 2 x records that = stDN



    Code:
    Set rs5 = CurrentDb.OpenRecordset("Select * From tblStock WHERE Status = '" & stDN & "'")
    With rs5
    Do Until rs5.EOF
    .Edit
    !Status = "Delivery"
    rs5.MoveNext
    .Update
    Loop
    End With
    Set rs5 = Nothing

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    why are you using code?
    run an update query. 100 times faster. No code errors.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I'd probably use a query too, but in the interest of learning, try moving the MoveNext line below the .Update line.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-10-2018, 07:48 AM
  2. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  3. Replies: 3
    Last Post: 01-23-2014, 07:49 AM
  4. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  5. Replies: 6
    Last Post: 05-30-2012, 12:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums