How to update "Availability" seat column in Table from available to unavailable? (1 Viewer)

Kirthana

New member
Local time
Today, 09:57
Joined
Nov 9, 2019
Messages
1
How to update "Availability" seat column in Table from available to unavailable?

Hello. I'm currently working on cinema seating system which have 3 auditoriums using VB. My system will support online booking and walk-in. I'm currently having trouble in preparing Database. Attached are the images.

May I know how to update "Availability" column in Booking Table from available to unavailable when I book seats by clicking the "Book" button in VB?

Thank you in advance.
 

Attachments

  • DB.PNG
    DB.PNG
    7.6 KB · Views: 117
  • Book & Reset.PNG
    Book & Reset.PNG
    20 KB · Views: 105

isladogs

MVP / VIP
Local time
Today, 17:57
Joined
Jan 14, 2017
Messages
18,207
Re: How to update "Availability" seat column in Table from available to unavailable?

Welcome to AWF
As June has already stated, this is a crosspost. Please read this article about the topic https://www.excelguru.ca/content.php?184
I've now added a link at the other forum(s) back to this one

If you do crosspost, please always include the links yourself

The easiest way to do this is using an update query or SQL statement.
If the Availability field is a boolean (yes/no) field then it would be something like this:

Code:
UPDATE TableName SET TableName.Availability=False WHERE SeatID = " & Me.SeatID

Or if its a text field, change to
Code:
UPDATE TableName SET TableName.Availability='Unavailable' WHERE SeatID = " & Me.SeatID

Modify table & field names as appropriate
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 09:57
Joined
Oct 29, 2018
Messages
21,447
Re: How to update "Availability" seat column in Table from available to unavailable?

Hi. If it was me, I wouldn't have the Availability column in the table. You should be able to tell/calculate if a seat is available or not by using the information on booked seats.
 

Micron

AWF VIP
Local time
Today, 12:57
Joined
Oct 20, 2018
Messages
3,478
Re: How to update "Availability" seat column in Table from available to unavailable?

Availability is the information on booked seats, no?

What I don't get is, why the "Number" field?
Both Number and Row are reserved words, by the way.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:57
Joined
Feb 28, 2001
Messages
27,127
Re: How to update "Availability" seat column in Table from available to unavailable?

Since we can't see anything else, theDBguy, there might be no separate booking table. Just a seat table of ROW/SEAT as shown in the first pic. For the given display in pic #2, that grid might be the best way for a novice to maintain the displayed image. You and I know it isn't the most efficient and is an example of Excel-think, but I believe the OP will find out soon enough that the Access way is different.

Kirthana - your design suffers from certain limiting issues. You can only book one day at a time with what you showed us and you have no historical information in case a customer calls you to say "Can you verify that we purchased tickets on date thus-and-such because we want to change the booking?"

You also have no way with what you showed us to track sales long-term and you have no way to deal with frequent customers. At least, based on what you showed us you don't.

In any case, you would not use VB to book the seats except in the sense that you would use VBA to generate a dynamically created UPDATE query (such as Isladogs showed you.) The UPDATE query would update the table. VBA doesn't do ANYTHING related to tables except through functions that use queries behind-the-scenes. VBA is the guide but SQL is what actually works on the tables.
 

Users who are viewing this thread

Top Bottom