Results 1 to 3 of 3
  1. #1
    W-technologies is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    3

    Automatically create numbers

    Hi Guys,

    sorry for the bad title, I'm not sure how to word what I want.

    im creating a product table and I want to Automatically create the product ID numbers instead of having to manually write them all in - example below

    so the product ID's will be

    WT-00001 to WT-20000



    i don't want to have to write the 20,000 before I start entering products and categories.

    does that make sense?

    thanks

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    One easy way would be to create the list in Excel, then Import into Access.

    Otherwise, you could probably use VBA and Recordsets with loops to generate the list directly in Access.

  3. #3
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    make table - product_ID - autonumber , product_desc - text

    now if your form/qry/report use this formating;
    "WT - " & IIf(Len([Product_ID])=1,"0000" & [product_id],IIf(Len([Product_ID])=2,"000" & [product_id],IIf(Len([Product_ID])=3,"00" & [product_id],IIf(Len([Product_ID])=4,"0" & [product_id],[product_id]))))

    included a sample db if i am not able to explain properly. shown use in both form and query.
    Attached Files Attached Files

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

Similar Threads

  1. Generating sequential numbers automatically
    By Malcolm41 in forum Access
    Replies: 2
    Last Post: 07-15-2012, 08:20 PM
  2. automatically assign numbers
    By gvh in forum Access
    Replies: 3
    Last Post: 12-08-2011, 01:53 PM
  3. Automatically create a new row
    By Palladian1881 in forum Access
    Replies: 1
    Last Post: 08-24-2011, 07:16 AM
  4. how do I create custom part numbers?
    By Sinatra Fan in forum Database Design
    Replies: 1
    Last Post: 09-01-2006, 04:09 PM
  5. automatically create queries
    By GEORGIA in forum Programming
    Replies: 8
    Last Post: 01-23-2006, 02:35 PM

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