Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Making tickets (2000)

    Well, the St. Marys Lincolns are doing well in their ice hockey playoffs. The seating is usually general, meaning there are so few people in attendance, where you sit is not a problem. However, the place has been packed the last couple of times. People are reluctant to leave their seats for anything during the game for fear that somebody will take their seat. We have decided to print tickets for a future game.

    We have Sections A to I with Rows A to H and Seats 1-41. What I want to do is create a merge to print out all the possible combinations so I have a ticket for every seat. The result would look like this: A-A-1, A-A-2 .....C-B-35....., and finally I-H-41. Any idea how to do this without typing every possible ticket stub?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Making tickets (2000)

    You could create a table tblSeats with three fields:
    Section (text, size 1)
    Row (text, size 1)
    Seat (number, byte)

    Copy the following code into a module:

    Sub CreateSeats()
    Dim cnn As ADODB.Connection
    Dim rst As New ADODB.Recordset
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    Set cnn = CurrentProject.Connection
    rst.Open "tblSeats", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect
    For i = 1 To 9
    For j = 1 To 8
    For k = 1 To 41
    rst.AddNew
    rst!Section = Chr(64 + i)
    rst!Row = Chr(64 + j)
    rst!Seat = k
    rst.Update
    Next k
    Next j
    Next i
    rst.Close
    Set rst = Nothing
    Set cnn = Nothing
    End Sub

    Click anywhere in the code and press F5 to run it. This should create 2952 records.

    Create a label report based on tblSeats. You can either create three separate text boxes for section, row and seat, or one text box with control source

    =[Section] & "-" & [Row] & "-" & [Seat]

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making tickets (2000)

    Hans, it worked! I have no idea why, but that's ok. If you can make it to St. Marys, I'll give you a couple of tickets for the game.

  4. #4
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making tickets (2000)

    Yuo can also do this without using code - by creating a 'triple cartesian join'. Create 3 tables - one which lists all of the Sections; one lists all of the rows and one lists all of the seats.

    Create a query with all three tables in and NO joins.

    See attached.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making tickets (2000)

    Hats off to you, too. As I said to Hans, if you can make it to St. Marys, I have a couple of free tickets for you to the hockey game.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •