Help creating a simple validation rule PLEASEEEEE

  • Hello

    I would like to create a validation which limits the number of records in to a table.

    The situation is-

    If there are a maximum of 5 seats at a concert then there are only 5 to sell.

    Yet there are a number of shows throughout the day.

    so a max of 5 people at each show.

    each show has its own number in the database yet falls under the field 'Show'

    Basically i would like to create a validation rule which goes something like

    If "show" (show numbers- 1 or 2 or 3...) =5 then a show a message the seats are fully booked

    This is so important! please hope to hear from you soon

    Regards

  • Without seeing your table defs and a description of your business case it's hard to tell...

    There are several versions around how to deal with such a scenario. Some are better than others. And we don't know which one you're using. So please help us help you and provide more details please.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Out of curiousity, why not do this in a query? Seems a better way. What am I missing?

  • Two ways to do this: Probably better to have a table with shows, a table with seats in the theater, and then a detail table that joins show and table. You can then easily query the seats remaining and know when seats are sold out.

    You could also set a constraint on the chair field, even though it's part of the PK.

    The first option gives you more flexibility I think.

  • THANK YOU LOT SO MUCH FOR THE REPLIES SO FAR

    This is a screen shot of the relationships with the fields in the database, it is now to late for me to re-arrange the database as the data has been imported and im on a very tight schedule, what is the best way to solve the above problem

    Please not the problem above was an example of what I had, as it was an easier way to explain it

    Basically I do not want double bookings or over bookings occurring at each of the stalls, however the stalls are availble for use for different shows throughout the day so applying a restriction on the number of records would not be a suitable way.

  • I don't know why you have the seats broken out by different tables depending on the type. These should be combined and identified by an additional field if necessary.

  • My teacher told me to break them up, because it will make it easier when it comes to the restricting of the seats. yet the dumb bloke has no idea on how to do it :exclamationmark:

    So stressed out atm because i need to save this database and make it usable 🙁

    please this is so important to me

    thanks for all the replies so far

    any questions please feel free to ask :pinch:

  • If this is for a school assignment, you really should be working this yourself. We normally help those trying to solve their job related issues.

  • Its for my dad!... he has asked me to do it as i am trying to get an a level in it

    i asked my teacher for advice yet he doesn't know how but said to break up the tables when i was planning them

  • OK, if it's for your dad, then don't listen to your teacher. All the seats should be in their own table and then joined to the booking detail. Once you have done that, you won't be able to add any seats that aren't in the seat table, so it will be automatically restrictive.

    You have a few other design errors. Seat ID and Customer ID don't have anything to do with the performance and need to be removed from the table. Credit card should be with booking and not with customer. Otherwise the customer couldn't use another credit card on a different purchase.

    What you have called the child table should be called the Booking Detail. It would be keyed on performance id and seat id.

    Hope this helps.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply