Results 1 to 4 of 4
  1. #1
    AccessThomas is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    26

    combobox causing update or cancelupdate error

    I have a split form with the records list set to the bottom of the screen. The top of the form has a chkbox that we check when we update a record. When I click on individual records listed at the bottom of the screen and click the chkbox there is no problem. However, If I click on my combobox to go to the record typed in, it will go to the record, but when I click on the chkbox, to show the record was updated, I get this error

    "update or cancelupdate without addnew or edit"

    Here is the code for the combobox:


    '------------------------------------------------------------' cboAccountName_AfterUpdate
    '
    '------------------------------------------------------------
    Private Sub cboAccountName_AfterUpdate()


    On Error GoTo cboAccountName_AfterUpdate_Err


    ' _AXL:<?xml version="1.0" encoding="UTF-16" standalone="no"?>
    ' <UserInterfaceMacro For="cboAccountNumber" Event="AfterUpdate" xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application"><Statements><Action Name="SearchForRecord"><Argum
    ' _AXL:ent Name="WhereCondition">="[Account Number] = " &amp; "'" &amp; [Screen].[ActiveControl] &amp; "'"</Argument></Action></Statements></UserInterfaceMacro>
    DoCmd.SearchForRecord , "", acFirst, "[Full Name] = " & "'" & Screen.ActiveControl & "'"




    cboAccountName_AfterUpdate_Exit:
    Exit Sub


    cboAccountName_AfterUpdate_Err:
    MsgBox Error$
    Resume cboAccountName_AfterUpdate_Exit


    End Sub

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    don't use SEARCH
    use filter:

    Code:
    Private Sub cboAccountName_AfterUpdate()
       if isNull(cboAccountname) then
           me.filterOn = false
       else
          me.filter = "[AcctName]='" & cboAccountname & "'"
          me.filterON = true
       end if
    end sub

  3. #3
    AccessThomas is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    26
    Gotcha, thanks.

  4. #4
    AccessThomas is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    26
    Ok, got the problem fixed.

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

Similar Threads

  1. Update or CancelUpdate without AddNew or Edit
    By westcoastbmx in forum Forms
    Replies: 5
    Last Post: 11-07-2019, 09:01 PM
  2. StrConv causing a read only error?
    By snipe in forum Forms
    Replies: 3
    Last Post: 08-12-2014, 11:02 AM
  3. Replies: 3
    Last Post: 05-26-2014, 11:51 PM
  4. Replies: 9
    Last Post: 04-01-2011, 10:31 AM
  5. Replies: 3
    Last Post: 03-07-2011, 08:37 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