Results 1 to 13 of 13
  1. #1
    Mr Anderson is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2018
    Posts
    6

    Multiply entries from one form submission


    Hi guys, I'm new to Access and i'm hoping you can help with a problem. Each year a club im part of hold a raffle which can be quite a task so i volunteered to build something in Access to allocate ticket numbers and collect name, address etc. The building of the form im ok with but the table is causing me an issue as i want the option to purchase multiple tickets. so far purchasing a single ticket is ok but when a quantity of more than one is entered the autonumber will give a ticket number of the last in sequence i.e if 5 tickets are selected it gives me a ticket number of 5 but i need it to show five entries with ticket numbers 1,2,3,4,5.
    I hope this makes sense. If you can offer any help i would be very grateful

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    you can either enter 5 records,
    or
    build a loop that uses the txtQty entry and does it for you

    Code:
    sub btnAdd_Click()
    dim i as integer
    
    for i = 1 to txtQty
       docmd.openquery "qaAdd1Ticket"
    next
    end sub

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would suggest NOT using an AutoNumber but build your own: http://www.baldyweb.com/CustomAutonumber.htm

  4. #4
    Mr Anderson is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2018
    Posts
    6
    Quote Originally Posted by ranman256 View Post
    you can either enter 5 records,
    or
    build a loop that uses the txtQty entry and does it for you

    Code:
    sub btnAdd_Click()
    dim i as integer
    
    for i = 1 to txtQty
       docmd.openquery "qaAdd1Ticket"
    next
    end sub
    Sorry this is all new to me, where can i input the code ?

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How are you currently adding a new record?

  6. #6
    Mr Anderson is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2018
    Posts
    6
    Adding new records through a basic form. Oh and thanks your patience I’m sure dealing with someone who doesn’t know what they are doing is frustrating

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How do you want the "new" numbers to be read out?

  8. #8
    Mr Anderson is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2018
    Posts
    6
    They don’t necessarily need to be shown on the form once the entry has been made. What I am trying to collect is an email address, first name & surname this then gets assigned a number (my range will be 1-1000) then once finished be able to pull some basic reports for the purpose of the draw

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So what you are probably going to want is a button on your form that will duplicate the last entry n times, right?

  10. #10
    Mr Anderson is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2018
    Posts
    6
    Yeah possibly, to be honest I’m not sure what the best option is. I thought this would be quite simple, that was my first mistake

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Welcome to the wonderful world of programming. Will anyone be running this system or just you?

  12. #12
    Mr Anderson is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2018
    Posts
    6
    Just me if I can get my head round it in time

  13. #13
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If you can see more than on record at a time, like in datasheet or continuous view, you can use windows copy and paste keys when adding the new records. I'm trying for suggestions that don't involve code if possible.

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

Similar Threads

  1. Replies: 7
    Last Post: 03-07-2017, 02:10 PM
  2. Incorrect field submission to table
    By Xarkath in forum Access
    Replies: 6
    Last Post: 06-03-2014, 01:12 PM
  3. I have question in multiply items form
    By kardo in forum Forms
    Replies: 3
    Last Post: 09-01-2013, 05:59 PM
  4. Add Line to Form Submission
    By kagoodwin13 in forum Forms
    Replies: 1
    Last Post: 02-21-2013, 10:46 PM
  5. Replies: 3
    Last Post: 06-08-2009, 08:20 AM

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