Results 1 to 2 of 2
  1. #1
    Meg is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    1

    Updating multiple records


    I just updated to Access 2010 and I'm having a problem adjusting. One of the features I built into my database form is code to update a field on GotFocus. This enables the user to review a text string based on the data fields they entered to, and it is also the field we use in the final report. (I first did this by a macro, but later updated it to code.)

    In earlier versions of Access, if I needed to change this field for many records I would go to the table view and change the data fields and then go to the form view, put my cursor in the field with the GotFocus trigger and zip through all the records by holding down the Next Record button.

    I've tried this in Access 2010, and holding down that button does nothing, so right now I have to click it to go to each record. Is there an option somewhere that would enable the press and hold, or a way I can run the code for all records at once? Or do I need to go back to my clunky macro? Or is there an easier way of dealing with this altogether? I've only had Access 2010 for a day, so I'm not even sure I can find where to make a new macro - still poking around.

    Thanks for any advice!

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Here's some simple SQL that you can use to update multiple records from a command button OnClick event procedure:

    currentdb.execute "Update [MyTable] set MyField = 'ABC' Where MyOtherField = 'DEF';", dbseechanges + dbfailonerror

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

Similar Threads

  1. Update query not updating records
    By toer121 in forum Queries
    Replies: 1
    Last Post: 08-25-2011, 07:08 AM
  2. HELP for updating selected records
    By explorer19 in forum Programming
    Replies: 7
    Last Post: 06-01-2011, 01:29 PM
  3. Replies: 1
    Last Post: 12-17-2010, 04:25 PM
  4. Updating Multiple Tables
    By gazzieh in forum Queries
    Replies: 0
    Last Post: 03-17-2010, 05:59 AM
  5. Replies: 1
    Last Post: 03-22-2007, 10:19 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