Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2013
    Posts
    53

    Unanswered: Auto assign values to range

    Hello All!

    Unsure if this is possible but here goes. Have the following QRY and would like to automatically assign a range of values i.e., 1-10 in a separate column to each record within each Batch# and reset after a new Batch#

    Problem is that within each Batch # there are multiple records assigned as well as multiple Batch #'s.

    Any suggestions? Thanks!

    Code:
    SELECT [Batch Summary].[Batch #], [Batch Summary].[Part Number], [Batch Summary].EL01MV AS Location, [Batch Summary].[# of Pieces], [Batch Summary].[Batch Create Date], [Batch Summary].[Batch Print Date]
    FROM [Ontario Move Batches] RIGHT JOIN [Batch Summary] ON [Ontario Move Batches].[Batch #] = [Batch Summary].[Batch #]
    WHERE ((([Ontario Move Batches].[Batch #]) Is Null))
    GROUP BY [Batch Summary].[Batch #], [Batch Summary].[Part Number], [Batch Summary].EL01MV, [Batch Summary].[# of Pieces], [Batch Summary].[Batch Create Date], [Batch Summary].[Batch Print Date]
    ORDER BY [Batch Summary].[Batch #], [Batch Summary].EL01MV;

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    Check this VBA based solution: Product Group Sequence with Auto-Numbers.

    This is an earlier Article, you may take a look at it:Auto-Numbering in Query Column.

    This Article gives details & Code for generating Auto-Numbers for the entire recordset of a Query.
    Last edited by apr pillai; 05-20-13 at 13:30.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Posting Permissions

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