Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    JorgeCUC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    9

    Creating Incremental Receipt Numbers

    I have limited Access skills but have a broad understanding of database
    queries and programming.

    I need to add an incremental receipt number to a table.
    All Gifts belonging to the same member get the same Invoice Number:
    Currently the Invoice Number is blank but it should look like this:

    MemID Gift Invoice Number
    1 Fund A 2011-000001
    2 Fund B 2011-000002
    3 Fund B 2011-000003
    3 Fund C 2011-000003
    3 Fund B 2011-000003


    7 Fund B 2011-000004
    7 Fund B 2011-000004
    8 Fund C 2011-000005
    10 Fund B 2011-000006
    15 Fund A 2011-000008

    What is the best way to do this?

    Thank you.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    See if this link gives you some ideas: http://www.baldyweb.com/CustomAutonumber.htm

  3. #3
    JorgeCUC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    Thanks, but that still doesn't solve the issue of assigning two different records the same Invoice Number.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That sounds like a 1:m relationship that is best handled with a Form/SubForm arrangement.

  5. #5
    JorgeCUC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    Would this require another table?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How many tables are we dealing with at the current time?

  7. #7
    JorgeCUC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    There's a Member Table, and a Donation table, so 2.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The Member table would be bound to the MainForm and the Donations table would be bound to the SubForm. Using the LinkChild/MasterFields you can get Access to fill in the Invoice Number in the Donations table.

  9. #9
    JorgeCUC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    The problem with that is that a Member can have more than one Invoice Number.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The relationship is between Invoices and Donations right?

  11. #11
    JorgeCUC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    Yes.
    Member gets a receipt listing all donations made for one month with one Invoice Number.

  12. #12
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you're using a bound form you're likely going to have to perform some sort of lookup (either dlookup or with a SQL statement, I prefer the SQL statements) and see if there as an existing invoice number for the combination of donor and fund. If there's more than 0 just apply the existing invoice number to the new record, otherwise create a new one.

  13. #13
    JorgeCUC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    Records are not given Invoice numbers until the end of the month.

    At the end of the month, ideally, I'd like run a query/macro that will update the db checking for all records without an invoice number, and assigning them one (making sure multiple Donations are assigned the same Invoice number.

  14. #14
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Here's an example. You will obviously have to adapt it for you dataset. However, I want to point out a couple of things. Is there a reason you aren't, at the beginning of a month, creating an invoice for a customer when they order their first item, then just add items to that invoice as the month progresses? Doing it the way you're proposing is a little bit backward.

  15. #15
    JorgeCUC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    Thanks for your help. I'll try this out with my db.

    I can't think of any reason we don't add an Invoice number right away.
    It used to be done yearly, and now we're to do it monthly. This is a db I inherited, and am trying to fix, so adding that functionality might be an good option.

    Thanks again.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Duplicating numbers....why??
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 01-21-2011, 01:32 PM
  2. numbers
    By Balen in forum Access
    Replies: 1
    Last Post: 08-17-2010, 05:16 PM
  3. Replies: 3
    Last Post: 10-18-2009, 08:38 PM
  4. HELP with crazy receipt numbering
    By jlm722 in forum Forms
    Replies: 15
    Last Post: 09-23-2009, 01:49 PM
  5. Random numbers
    By Gator777 in forum Access
    Replies: 3
    Last Post: 08-12-2009, 10:04 AM

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