Results 1 to 5 of 5
  1. #1
    Master Klick is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    47

    Form to update table


    I'm using a button and a macro to update a quantity field in a table. I am getting a 3113 runtime error. Anyone know what I should look for to fix this?

    And, sorry, I was not able to upload the database.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What is this quantity field for and why do you need to use code to edit it? Is this a macro or VBA? Are you using SetValue action in macro?

    What is the exact message given by the error?

    Post code for analysis.

    Why are you not able to upload database?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    As June7 said, we need to know how you're trying to do this. Error 3113 indicates that the Field cannot be updated.

    Linq ;0)>

  4. #4
    Master Klick is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    47
    Error:
    Runtime error '3113':
    Cannot update 'Quantity'; Field not updatable

    Code:
    Private Sub PlusOne_Click()
    DoCmd.SetWarnings False
    Dim strSQL As String
    strSQL = "UPDATE [Inventory] SET [Quantity] = [Quantity] + 1 " & _
    "WHERE [Inventory].[ID] = " & Me!
    [List] & ";"
    DoCmd.RunSQL strSQL
    Me!List.Requery
    DoCmd.SetWarnings True
    End Sub

    This is for cataloging a card collection. There are many many things to sort by and the best way to update the quantity is from a form as sorting through 240000+ in a table would take forever and a day.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why would the Quantity field not be updatable?

    Why are you saving calculated value anyway? Saving calculated data is usually a bad idea, especially aggregate calcs.

    Review http://allenbrowne.com/AppInventory.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Update table from form
    By WickidWe in forum Forms
    Replies: 8
    Last Post: 12-15-2013, 09:08 PM
  2. Update Table from Form
    By NISMOJim in forum Forms
    Replies: 12
    Last Post: 10-28-2013, 01:30 PM
  3. Replies: 7
    Last Post: 09-21-2012, 11:09 AM
  4. Replies: 2
    Last Post: 12-22-2010, 01:46 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