Results 1 to 13 of 13
  1. #1
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102

    Runt time error 3164 field can not be updated

    I am (STILL) working on the attached inventory control db, and have it pretty close to what I need it to do, except for one thing that is giving me trouble.

    I have a form called frmAssigned that is based on a query and a table by the same name. the form allows me to choose an employee, select a category and size of an item to ad to a list, blah, blah, blah...

    along with the item being added, I can indicated a quantity of that item in a text box on the form called txtHRQuant (this is the number of the selected item being issued to the employee). I also have a textbox (txtOnHand) that shows the "quantity available" of an item that the underlying query pulls from a different table (tblproducts) that shows the number in inventory.

    what I am ultimately trying to do is subtract the quantity issued (txtHRQuant) from the available quantity (txtOnHand), then put the resulting number back into the table in the correct recordset for the item selected. I hope I explained that well enough.

    I have tried several versions of VBA and when I try to "write" the result back to the table (tblProducts), I get an error that says "run time error 3164, field can not be updated". which I find a little funny, because there is another form (frmAddItems) that I use to write data to the exact same quantity location on the products table and there are no errors. in other words, there are 2 different forms sending updated values to the same field on a table, one of the forms causes an error, the other doesn't, which would make me believe that it is NOT a question of the field being disabled, locked, or uneditable.



    I am sure it is something that I am missing or just haven't learned yet.

    Anyway, thanks for the time, and I seriously appreciate any help
    MikeALWorking.zip

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm going to start with two suggested links:

    http://allenbrowne.com/ser-61.html
    http://allenbrowne.com/casu-14.html
    .
    If you've reviewed these links to no avail then post back and we can look deeper.

  3. #3
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    Quote Originally Posted by RuralGuy View Post
    I'm going to start with two suggested links:

    http://allenbrowne.com/ser-61.html
    http://allenbrowne.com/casu-14.html
    .
    If you've reviewed these links to no avail then post back and we can look deeper.
    Thanks for taking a look, but I don't think either situation applies. I have a very simple query set up, and there is another form out there that is able to write data back to the table, so it seems to be working from that angel, at least.

    I am also not using any calculated fields. All of the calculations are coded into the onclick even of a button on the form, and the new calculated total needs to be stored, so I can't use a calculated field. the error occurs after the math is completed and at the point where the data (new calculated total) is attempted to be written back to the table.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    I got this attached error when trying to use the form.
    Click image for larger version. 

Name:	Error_ALWorking0.jpg 
Views:	21 
Size:	105.5 KB 
ID:	22491

  5. #5
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    hmm, I have never seen that one before, and, except for the related error, works OK.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Wellll! I'm able to get your error and so far unable to figure out why. I think it should work.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm going to take my best guess. The txtOnHand control is bound to the Quantity field of the tblProducts table. The cmbHRDescription cbo is bound to essentially a query of the tblProducts table. The AfterUpdate event of the cmbHRCategorySelect cbo REQUERIES the cmbHRDescription cbo (which is needed) but it probably invalidates the current frmAssigned Recordset and so the bound field of the txtOnHand control as well. The test for this would be to try and modify the txtOnHand control before the REQUERY.
    It is just a guess. I have not tried it yet, but I will.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Okay, that was an interesting exercise but useless. Same problem. I'll keep looking.

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I pretty convinced there is nothing in the form to synchronize the Recordset to your actions. Basically, I believe the Form's Record Source is really not valid for writing to. I don't know how I would change it yet. Still looking.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    From Help:
    If there is no current record, as when there are no records in the
    Recordset object, AbsolutePosition returns –1. If the current
    record is deleted, the AbsolutePosition property value isn't defined, and
    a trappable error occurs if it's referenced. New records are added to the end of
    the sequence.
    I've added a TextBox txtShow to the form and it *always* returns -1. This means there in NEVER a valid record in the Form's Recordset.
    Attached Files Attached Files

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I hope that is helpful to you. I know it was to me. As I suspected, it will not work as you expect until you can synchronize the recordset and I do not see any useful way to do that.

  12. #12
    sprtrmp is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    Greenville, SC
    Posts
    102
    hmmm, very curious. I don't understand why it is acting that way.
    ah well, back to the drawing board. thanks for spending the time with it.

  13. #13
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're very welcome.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-13-2015, 01:33 PM
  2. Replies: 6
    Last Post: 07-24-2014, 08:18 AM
  3. Field Cannot be updated - Error
    By aamer in forum Access
    Replies: 14
    Last Post: 06-21-2014, 05:20 AM
  4. Error # 3164 "field cannot be updated"
    By bbrazeau in forum Access
    Replies: 3
    Last Post: 08-29-2013, 01:18 PM
  5. the last updated date and time
    By venu in forum Access
    Replies: 2
    Last Post: 04-02-2010, 08:11 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