Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    WildBill is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2021
    Posts
    9

    Stacked Ticket Numbering

    I need a macro that will create a comma delimited csv file that will be used to create tickets (10 up sheet) in "stacked" order so that they can be stapled in sequential order. For example, say I need 50 tickets, 1-5 in stack one, 6-10 in stack two, 11-15 in stack 3, 16 -20 in stack 4, 21-25 in stack 5, etc. The software prints the tickets this sequence.
    Click image for larger version. 

Name:	TICKET.png 
Views:	33 
Size:	17.3 KB 
ID:	46001
    I've tried this using excel but ran into bugs. Someone suggested doing it in access. Any help would be appresicated.



    WildBill

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    in the report, in page setup,
    columns tab,
    set # of columns = 2

    then column layout, either :
    print down 1st then across
    or
    across 1st , then down

  3. #3
    WildBill is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2021
    Posts
    9
    Sorry I'm at a loss. i have even started. I was using Excel.

  4. #4
    WildBill is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2021
    Posts
    9
    This is an image of a spreadsheet result of what I'm trying to do in Access. The first is the input on Sheet 1 and the second is the result on sheet 2
    Click image for larger version. 

Name:	Picture1.png 
Views:	24 
Size:	11.8 KB 
ID:	46013Click image for larger version. 

Name:	Picture2.png 
Views:	24 
Size:	7.0 KB 
ID:	46014

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,939
    To clarify your first post, where does the csv file come into it? Or do you need a report to print the tickets? In which case does it matter if tickets appear bottom left of the sheet or top left? (Top left would be easy to do)

    Or are you just looking for a list of numbers in the specified order per your spreadsheet?

  6. #6
    WildBill is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2021
    Posts
    9
    The CSV file is used by a third party ticketing software. The tickets are 10 to a sheet but the software doesn't "stack" them sequentially. The merge csv file will do that in the layout as described above. Thanks, Bill

    PS, I supposed I could print the tickets directly from Access if I could figure out how to create the "stacked" numbering.

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,939
    ‘Layout as described above’ is just a list of numbers in the specified order per you spreadsheet?

    And you haven’t said whether the order of the pack of 5 tickets matter, so long as tickets 1-5 are in the same pack, 6-10 in another etc

    You have 3 dimensions you need to determine from any number - row, column and page. And then you need to sort these accordingly

    Investigate using the mod and \ operators to determine these values

    You are not clear about whether it matters where on the sheet 1-5 appears or whether you want to do this as a report so can’t really advise further

  8. #8
    WildBill is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2021
    Posts
    9
    Quote Originally Posted by Ajax View Post
    ‘Layout as described above’ is just a list of numbers in the specified order per you spreadsheet?

    And you haven’t said whether the order of the pack of 5 tickets matter, so long as tickets 1-5 are in the same pack, 6-10 in another etc

    You have 3 dimensions you need to determine from any number - row, column and page. And then you need to sort these accordingly

    Investigate using the mod and \ operators to determine these values

    You are not clear about whether it matters where on the sheet 1-5 appears or whether you want to do this as a report so can’t really advise further
    Sorry, thought this was included. The layout is how the ticket software lays it out.Click image for larger version. 

Name:	TICKET.png 
Views:	21 
Size:	17.3 KB 
ID:	46015
    There are 10 tickets per sheet.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    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.

  10. #10
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    So this is what the first 3 pages should look like?
    page 1 page 2 page 3
    25 50 24 49 23 48
    20 45 19 44 18 43
    15 40 14 39 13 38
    10 35 9 34 8 33
    5 30 4 29 3 28

    My current thought is to have a report with 9 calculated controls positioned like what you've shown. The 50 textbox doesn't need a calculation, just the seed value. Open the report, calculations are based on a seed value (50 in your case) and are performed in a loop. Print the page, subtract 1 from the seed value, refresh the report and print again. I suppose the loop needs a counter based on the number of pages (5). A mathematical calculation could control the loop, but if anything goes wrong with that you could end up with a whole lot of useless pages from being stuck in a printing loop.

    You could also just use code to populate the controls with calculated values. That would require 10 lines of code just for that part. Not too onerous or repetitive I guess.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    WildBill is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2021
    Posts
    9
    In this illustration, there would be 5 sheets of paper, each with ten tickets. Sheet 1 would have numbers 1,6,11,15,21,26,31,36,41,46. Sheet 2 would have numbers 2,7,12,16,22,27,32,42,47. Sheet 3 etc.

  12. #12
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    I'd probably go with what was linked in post 9 but you could go with calculated controls:

    Click image for larger version. 

Name:	1rptStacked.jpg 
Views:	21 
Size:	20.9 KB 
ID:	46017

    and then code like this in a standard module

    Code:
    Option Compare Database
    Option Explicit
    Public ctr As Integer
    
    Private Sub PrintTickets()
    
    ctr = 1
    Do Until ctr = 6
       DoCmd.OpenReport "rptStackedTicket", acViewPreview '<< open normal instead so that it just prints out
       ctr = ctr + 1
       DoCmd.Close acReport, "rptStackedTicket"
    Loop
    
    End Sub
    and this in the report Load event
    Code:
    Private Sub Report_Load()
    Me.txt1 = ctr
    MsgBox "printing page " & ctr
    
    End Sub
    With that method, you might experience screen flicker and opening/closing a report in a loop is not the most efficient thing to do. Opening hidden might eliminate any flicker you might get, but again, if the report was opened based on a table, you'd open it once and have a break (section or page) below the bottom controls.

    EDIT - I might add that the above works (except I chose not to actually print the pages). Also, in the 1st set of numbers in post 11, 15 would be 16 and in the 2nd set, 16 would be 17. I took it that the sequences were not correct.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  13. #13
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,939
    So still no answer to my question. I don’t think you get what I’m asking about order or what needs to be saved to a csv file. And looks like others are struggling to understand as well. So think it better if I drop out.

    As I said, you will need to use the mod and \ operators to determine page, row and column for each ticket number.

    Page for example would be

    ((Ticketnum-1)\10)+1

    Where 10 is the number of tickets per page
    Last edited by CJ_London; 08-22-2021 at 05:01 PM.

  14. #14
    WildBill is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2021
    Posts
    9
    Thank Everyone for your help, I think I can get it from here.

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Wrong link posted. See later post.
    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.

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

Similar Threads

  1. Replies: 3
    Last Post: 12-03-2015, 09:04 PM
  2. Send Ticket Number Through SMS
    By kibria78 in forum Access
    Replies: 1
    Last Post: 07-15-2012, 03:52 PM
  3. Replies: 1
    Last Post: 06-06-2011, 06:50 PM
  4. creating automated ticket number
    By speak2des in forum Access
    Replies: 1
    Last Post: 02-25-2010, 11:32 AM
  5. VBA and stacked queries
    By Pudy in forum Queries
    Replies: 0
    Last Post: 11-28-2006, 03:58 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