Sequential numbers (1 Viewer)

OnlyTD

Registered User.
Local time
Today, 09:14
Joined
Jul 26, 2018
Messages
42
Hi

I have a form for booking tickets for events.

I have a table of Events, a table of Attendees and a link table of Event-Bookings which uses the Event_ID and the Attendee_ID to records the quantity, type of ticket and ticket number etc.

My main form is based on the table of events and the sub form is based on a query.

I am having problems making ticket number field use the next sequential number for each particular event.

Please can anyone help?
 

MarkK

bit cruncher
Local time
Today, 09:14
Joined
Mar 17, 2004
Messages
8,178
I am having problems making ticket number field use the next sequential number for each particular event.
How are you doing this? What problems are you running into? Showing your work will be an enormous help in our understanding of what is going wrong for you.
Mark
 

plog

Banishment Pending
Local time
Today, 11:14
Joined
May 11, 2011
Messages
11,611
I am having problems making ticket number field use the next sequential number for each particular event

What's so important about using sequential numbers? Do your ticket numbers need to accomplish something other than being unique?

You should make your ticket numbers be autonumbers and not worry about how 'pretty' they are.
 

MarkK

bit cruncher
Local time
Today, 09:14
Joined
Mar 17, 2004
Messages
8,178
And I totally agree with plog on this. A sequence is a just a sort order, and you can assert any sort order you want, who cares? Is is uniqueness that has real value; being able to uniquely identify and permanently distinguish one instance of an object from all other instances.
hth
Mark
 

OnlyTD

Registered User.
Local time
Today, 09:14
Joined
Jul 26, 2018
Messages
42
Hi
Thank you for your replies.

The sub form is sorted into ticket number order and the user should then just type in the next number but somehow the have managed to skip numbers so I have been asked if I can make the next number fill in automatically.
The ticket numbers are 1 - 100 for each event, one person can have several tickets.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 16:14
Joined
Feb 19, 2013
Messages
16,553
to do what you want, look to the bottom of this thread and you will see a number of links to threads that have asked the same question
 

OnlyTD

Registered User.
Local time
Today, 09:14
Joined
Jul 26, 2018
Messages
42
Hi

I have looked at the links below and none of them are answering my question.

I only want the sequence to happen per event.
 

MarkK

bit cruncher
Local time
Today, 09:14
Joined
Mar 17, 2004
Messages
8,178
If there are 100 actual discrete and unique things--tickets in this case--that you create for an event, I suggest you make them all at once in a batch. Imagine code like...
Code:
for i = 1 to 100
[COLOR="Green"]   ' Insert ticket i into table[/COLOR]
next
That way you have pre-created the finite set of things you'll need. Then how you distribute them becomes a simpler problem, if you don't also have to create them at distribution time.
hth
Mark
 

OnlyTD

Registered User.
Local time
Today, 09:14
Joined
Jul 26, 2018
Messages
42
Hi Mark

thank you for your answer.

I am looking to add a ticket sale record only if the ticket is sold.

I have attached a sample of the database in question, hopefully this will help.

thank you
 

Attachments

  • Event Bookings Sample.accdb
    1.6 MB · Views: 55

CJ_London

Super Moderator
Staff member
Local time
Today, 16:14
Joined
Feb 19, 2013
Messages
16,553
I have looked at the links below and none of them are answering my question.
The second one down asks the same question - different scenario but same requirement. If this is not the case then your requirement is not clear, please explain why it does not meet your requirement
 

MarkK

bit cruncher
Local time
Today, 09:14
Joined
Mar 17, 2004
Messages
8,178
I am looking to add a ticket sale record only if the ticket is sold.
Ticket creation and ticket sale are not the same data. Your question is about sequentially numbering the ticket, and it would be simplest--as a solution to sequentially numbering them--if you create them in advance, in a batch, in a loop.

Then, the matter of recording the sale is a different problem, which should be recorded in a different table.

hth
Mark
 

Users who are viewing this thread

Top Bottom