Results 1 to 6 of 6
  1. #1
    westcoastbmx is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    9

    Update or CancelUpdate without AddNew or Edit

    I have a Form with two combo boxes at the top and about 7 subforms below it. The two comboboxes Are Country and State and filter the 7 forms below. When I select a country and State and then try and edit a subform I get the error " Update or CancelUpdate without AddNew or Edit" any ideas... Thanks and the code is below as an after Update. If you would like to see the Database let me know.


    Option Compare Database

    Private Sub cboCity_AfterUpdate()



    End Sub

    Private Sub cboCountry_AfterUpdate()
    On Error Resume Next
    cbocity.RowSource = "Select tblAll.City " & _
    "FROM tblAll " & _
    "WHERE tblAll.Country = '" & cboCountry.Value & "' " & _
    "ORDER BY tblAll.City;"
    End Sub

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try using a query as the RecordSource of your forms instead of tables.

  3. #3
    westcoastbmx is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    9
    I will try this

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Post back here if you are still having problems.

  5. #5
    Join Date
    Nov 2019
    Posts
    8
    Just FYI - I tried this and it's not working. Fixing to post a new thread. I'm so annoyed that I cannot get my subform to properly allow me to add records without interruptions. I have a query based subform in datasheet view. I have two tables within this query which both have a primary key. I keep getting #error if the record is not properly filled out and prompt for required fields. I do not know a workaround. I need it to continue in "edit" mode and not keep acting like it should be submitted. I have several required fields in my details table but if they do not fill it out properly they shouldn't have to click ESC to clear new record and restart entering it all over again. It's annoying.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Please do post your own thread with details about your form(s), how they're being used and exactly what the issues are because this one is 10 years old. I also get the impression that your form is based on a query using 2 or more related tables, and that is probably your main problem. Typically it is a one form to one table (query) that should be created unless you are prepared to do a bit of coding to prevent issues. Or use temporary records in "temp" tables and copy over when all is done.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Allow some users to edit, and other to only view?
    By Tommy1005 in forum Security
    Replies: 2
    Last Post: 11-09-2009, 09:33 AM
  2. combo box disable edit (update)
    By jheacox in forum Forms
    Replies: 10
    Last Post: 09-28-2009, 10:07 AM
  3. Can't Edit Date Field
    By MOtis in forum Forms
    Replies: 1
    Last Post: 09-10-2009, 03:57 AM
  4. Replies: 3
    Last Post: 08-06-2009, 11:49 PM
  5. Can I edit a record with a subform?
    By bigmax in forum Forms
    Replies: 0
    Last Post: 08-11-2008, 07:55 AM

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