Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160

    Unanswered: Update query, starting at 1 to no. of records

    Hi all,

    I'm trying to use the update query to change a field in my table.

    I would like to run an update query which will increment a value starting at 1 to the number of records which the query has pulled.

    So if 5 records matched my criteria it would update say Field_X, starting at 1 to 5.

    Record 1 Field_X = 1
    Record 2 Field_X = 2
    Record 3 Field_X = 3
    Record 4 Field_X = 4
    Record 5 Field_X = 5

    Any ideas any one?

    thanks
    marcus

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Here are two links to hacks for doing this sort of thing:

    NumberedQuery.mdb (beginner) - Roger's Access Library

    RowNumber
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160
    thanks, some useful stuff on there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •