p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   Booking program. (http://p2p.wrox.com/showthread.php?t=42004)

Tankey May 2nd, 2006 12:36 PM

Booking program.
I'm currently doing a project that involves createing a booking database for a hall. Its almost completed but i've hit a wall.

Each day is split into 3 booking parts, morning, afternoon and evening. Some of these days are reserved for groups and need to be 'blocked' to prevent double booking. I was hopeing to intergrate the 'calendar control 9.0' but so far, frankly, i'm clueless. Unless there is another option where i can display a similer way in a form where its user friendly to just select a day, slot and continue a booking i'm very much open to suggestion. Furthermore if this can be displayed in a report or simply printed out from the form showing all bookings for a week would also be awsome.

I would normaly talk to my tutor about this, however he is on long term illness and the replacement teachers have no clue as my college is quite small (uk).

I know its a lot to ask but this is my last resort. If anyone is willing to help, any information your wish to share, please explain it aswell, due to the fact i'm a student and only have just started I would like to fully understand so i am able to do it with clear knowlage in future.


kindler May 2nd, 2006 03:56 PM

Here's a way you can show your bookings and prevent double bookings. Create a table for bookings with the Date, Session (Morning/Afternoon/Evening using a Value List lookup), and Party identifier. Set the primary key for that table to be Date & Session. That prevents anyone from booking the same date/session if it's already there. Create a form that contains Calendar Control and a subform bound to the bookings table. Open up VBE (Alt-F11) and put the following code in the file for that form:

Private Sub Calendar0_Click()
Me.Bookings_subform.Form.RecordSource = "SELECT Date, Session, Party FROM Bookings WHERE Date = #" & Me.Calendar0.Value & "#;"
End Sub

Edit any of the control names to match what you have. That will show what bookings are on a given day, and allow you to add new ones that don't conflict with existing ones. You can play around with code and appearance to make the interface according to your own desires at this point, whether you want to have a form that has an Option Group of the Sessions and disable the sessions on a given date, or what not. I'd really need more specifications before going into any further design.

All times are GMT -4. The time now is 07:30 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.