Results 1 to 4 of 4
  1. #1
    P5C768 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95

    Update All Records in a Table from a Form

    Is there a way to update all records in a table with the information currently entered on a form in single form view (bound form that updates the table whe the form is updated). For example, when I'm on the form, I see a single record at a time, but I would like to have a button that updates all records in the table when clicked.



    Do I need to cycle through each record in a loop or is there something like all.field I could use (as opposed to me.field, which is used to only update the current record)?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You could execute an update query:

    UPDATE TableName
    SET FieldName = Forms!FormName.TextboxName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    P5C768 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95
    I should have clarified, the two fields that I am trying to have updated are calculated fields based on two other fields on the form (field1*field2*0.85). I only recently added these fields for users. When they create new records, the after update event of either of the two fields needed calls a module that performs the calculation and updates the field I want to store the result in.

    Now I'm trying to go through and update records that were entered before I made this change, without going through each record.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would probably not store a calculated field. You're seeing one reason why. If you really want to, you can still use an update query:

    SET FieldName = field1*field2*0.85

    or whatever is appropriate to your situation.
    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: 2
    Last Post: 12-22-2010, 01:46 PM
  2. Combo box to update table in a form
    By TG_W in forum Programming
    Replies: 1
    Last Post: 05-20-2010, 01:59 PM
  3. Replies: 0
    Last Post: 02-24-2010, 12:56 AM
  4. Replies: 5
    Last Post: 01-05-2010, 10:22 PM
  5. Update table from calculated field in a form
    By BernardKane in forum Forms
    Replies: 3
    Last Post: 11-28-2006, 09:48 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