Results 1 to 8 of 8
  1. #1
    Megood is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    17

    Question Number generator without Autonumber?


    I am very efficient with Access but not so much with code. I need to create a numbering system where I can select the start number(what company want their customer to know their customer number 2?). I think it would be best to use an "IF" statement for the beginning number and from there on, find the highest number in another table and add 1. I want to select the number of digit. Autonumber will not work because i need it to be repeatable for multiple records. Quotes can have multiple services and specification but share the same quote number.

    Help would be appreciated. Thank you!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Have you used form/subform arrangements?

    Main form bound to quote records table and subform(s) bound to services and specifications tables. Subform links will automatically save the quote number into the service or specification record when other data entered.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Megood is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    17
    Well, I do feel like an idiot for not realizing that, thank you! I've done it so many times I don't know why I didn't think of it. Thank you!

    But I still want to generate a number with as many digits that I want.

  4. #4
    Megood is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    17
    Could someone please tell me how to write a number in a field using code or a macro? I'm kinda sure I can come up with some query.field + 1. I just never used created a recordset.

  5. #5
    Megood is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    17
    Ok, maybe I can be a bit more exact. I have a form/subforms that already had a unique ID and I have a field for quote number and another for order number(click button to initiate order and it fills in the number). This seemed better then multiple tables for orders and quotes. and no large recordsets for all this info. I am open to Ideas.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Review this thread that discusses generating unique identifier https://www.accessforums.net/databas...try-21975.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Megood is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    17
    Thank you for that. I am just learning VB and am just getting what is said. I decided to simplify the Client and Quote IDs a bit. I used an Autonumber and a calculated field that added a large number of where I wanted to start. But I don't want this for the actual order numbers. Thank you for your help.

    I want to make it so I can have a button that will assign the number once the order is signed and this needs to be in order. I don't want skipped numbers, as can happen with autonumber. Unfortunatly I am now having form issues that I don't understand.

  8. #8
    Megood is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    17
    I just went the simple route. Autonumber field = my number. I sill have issues with missing skipped numbers but I suppose its fine. Thanks June7 for your help!

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

Similar Threads

  1. Account ID - Generator
    By sschrader1 in forum Queries
    Replies: 4
    Last Post: 04-09-2012, 08:09 AM
  2. Replies: 6
    Last Post: 03-21-2012, 07:13 PM
  3. Code Generator
    By fpmsi in forum Programming
    Replies: 1
    Last Post: 09-20-2011, 08:46 AM
  4. Generated number do not trigger autonumber
    By Douglasrac in forum Forms
    Replies: 10
    Last Post: 03-29-2011, 08:44 AM
  5. Sorta Random Serial Number Generator
    By Cuselco in forum Programming
    Replies: 3
    Last Post: 08-27-2010, 12:05 PM

Tags for this Thread

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