UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> A problem with marking dates    
 
   
RiaJones
post Nov 20 2003, 01:07 PM
Post #1

New Member
Posts: 18
From: Essex, no jokes



Can anyone help? I'm designing a database for a villa letting system and I need to ensure that the database will mark the dates that I choose booked so that there are no double bookings. How do I do this?
Go to the top of the page
 
+
RymCo
post Nov 20 2003, 01:25 PM
Post #2

UtterAccess Enthusiast
Posts: 53



Assuming one booking per day...make the BookingDate a primary key in the table. If you can have multiple bookings per day then it gets more complicated.
Go to the top of the page
 
+
jsitraining
post Nov 20 2003, 01:34 PM
Post #3

UtterAccess VIP
Posts: 5,230
From: Scotland (Sunny Glasgow)



Hi
Do not make the Booking date the primary number in the table. The primary key should not consist of data meaningful to the user. As a general rule the PK should be an autonumber field.
Are yo working with multiple villas or a single villa?
If it is a single villa then you could set the index for the date booked to No Duplicates. Multiple villas would be a different proposition.
If you need more help post back
Jim
Go to the top of the page
 
+
RiaJones
post Nov 21 2003, 04:19 AM
Post #4

New Member
Posts: 18
From: Essex, no jokes



hi thanks loads for your help.
yeah i'm afraid its 13 villas and many bookings need to be made on one day. Nightmare!!!! You sound like a genius though so could you help me again please!!
thanks
Go to the top of the page
 
+
loonatik3
post Nov 21 2003, 04:24 AM
Post #5

UtterAccess Veteran
Posts: 354
From: Warwickshire, England



you still having problems
i daily work on a database for a holiday company and can help you alot

Loonatik
Go to the top of the page
 
+
jsitraining
post Nov 21 2003, 05:17 AM
Post #6

UtterAccess VIP
Posts: 5,230
From: Scotland (Sunny Glasgow)



Hi
I'm no genius but if you set up your structure right, it should be fairly straightforward.
Have a table for the thirteen Villas:
tblVillas
Villa_ID (Primary Key, AutoNumber)
Villa Name
Address details etc of Villa

tblCustomers
Customer_ID (Primary Key Autonumber)
FName
SName
Address et al

tblBookings
BookingID (PrimaryKey Autonumber)
CustomerID (Number, Long Integer)
VillaID( Number, Long Integer)
Date of Booking
Duration of Booking

Make the Date of booking and VillaID in the tblBookings table an Index (in design view of the table you click on the Idexes tool, Name the Index then list the fields to include in the Index) This will make the combination of the two fields, Unique.

However, this only ensures that a villa cannot be booked twice for the same start day:
Customer A might book Villa 1 for 14 nights on 17/11/03
Therfore villa booked till 01/12/03
Customer B might also book Villa 1 for 7 nights starting 24/11/03
Since the viilaID is the same, but the Date of booking is different, this would be allowed in the index but op course would mean that you are double booked for the last week in November (with two somewhat disgruntled customers )
Some form level validation would probably be the best way to go.
How do you handle it Loonatik (I bow to your experience )
Jim
Go to the top of the page
 
+
RiaJones
post Nov 21 2003, 08:46 AM
Post #7

New Member
Posts: 18
From: Essex, no jokes



thanks u lot, your legends!!!! if you know then cen u help me pls lunatic. i want to ensure that no double bookings are made for each of the 13 villas I have. i'd also like to be able to use the Calendar to select dates so that i can choose a start date of a booking as "1/1/04" for example, and then and end date of "7/1/04" and i would like it to select the dates in between.
how bloody complicated, or maybe i'm just a simpleton!!

ri
Go to the top of the page
 
+
loonatik3
post Nov 21 2003, 11:00 AM
Post #8

UtterAccess Veteran
Posts: 354
From: Warwickshire, England



hi
we are currently using wall boards to show options and bookings however, stick with me because I am just designing an availability form to show if properties are vacant or booked and I will be happy to pass it on to you when it is completed. Anything else you might be interested in? Do you do flights too?

Loonatik
Go to the top of the page
 
+
jsitraining
post Nov 22 2003, 06:47 AM
Post #9

UtterAccess VIP
Posts: 5,230
From: Scotland (Sunny Glasgow)



Hi
Check out the attachment for indicating if there is a duplicate booking. If you need more help don't hesitate to ask
Jim
Go to the top of the page
 
+
RiaJones
post Nov 23 2003, 10:20 AM
Post #10

New Member
Posts: 18
From: Essex, no jokes



cheers Jim, i'll look over that on Monday. I've managed to find an internet site showing how I can use the Calender in Access using Visual Basic but its not allowing me to do bookings or anything with the dates so i'll leave the calendar out!!
Hey Loonatik, thanks 4 yr help, no i'm not doing flights just booking for the villas and whether they need a transfer or not. could i just have a look at how you've done your availability forms, that would be a great help. When do you hope to be finished by?

Ri
Go to the top of the page
 
+
RiaJones
post Nov 24 2003, 07:46 AM
Post #11

New Member
Posts: 18
From: Essex, no jokes



Hey,Sorry to bother u again!! Do you know if I can use the calendar to select dates and put them into some kind of form or table?

ri
Go to the top of the page
 
+
lentin
post Nov 25 2003, 12:48 AM
Post #12

UtterAccess Member
Posts: 30
From: Chatham, Kent, UK



Hiya, live just south of the river from you, so I can't joke you're too near. Anyways I am working on roughly the same thing as you except mine is an Apart Hotel, and tonight I have finally managed to do something in Access that works. It isn't exactly what I wanted , and may not be what you want but it will give you an idea of how to go about getting it but at least it does work. Have a try.
Go to the top of the page
 
+
RiaJones
post Nov 25 2003, 03:26 AM
Post #13

New Member
Posts: 18
From: Essex, no jokes



cheers yr a legend!! i'm gonna have a butchers today and i'll get back to u this afternoon some time.

ri
Go to the top of the page
 
+
RiaJones
post Nov 25 2003, 08:47 AM
Post #14

New Member
Posts: 18
From: Essex, no jokes



hey yeah that was really useful.are u doing yr work for a company?

ri
Go to the top of the page
 
+
loonatik3
post Nov 25 2003, 08:51 AM
Post #15

UtterAccess Veteran
Posts: 354
From: Warwickshire, England



I've attached the basics of what I've done. I know it might seem long winded but I feel more comfortable with less code that I am not always sure how to amend when things go wrong.
They are currently all showing vacant as I am doing the dates for 2004 and only currently have 2003 dates but if you go to bookings and change the dates to 2004 you will see how they work.

Loonatik

Go to the top of the page
 
+
rrush
post Nov 25 2003, 09:03 AM
Post #16

UtterAccess Enthusiast
Posts: 56
From: Maryland



what website did you find? I'm working on a vacation request calendar and need all of the help I can get.
Go to the top of the page
 
+
RiaJones
post Nov 26 2003, 03:28 AM
Post #17

New Member
Posts: 18
From: Essex, no jokes



i found it on microsoft msdn site, its quite good. just look up calendar 9.0 or 10.0. i hope thats some help

ria
Go to the top of the page
 
+
RiaJones
post Nov 26 2003, 03:31 AM
Post #18

New Member
Posts: 18
From: Essex, no jokes



i can't find the attachment in your message!!!!! could u send it again please.

ri
Go to the top of the page
 
+
RiaJones
post Nov 26 2003, 05:25 AM
Post #19

New Member
Posts: 18
From: Essex, no jokes



sorry could u help me out again pls? i must be really peeing u off!!
there are 13 families that own the 13 villas on the same complex and so if a booking is made, the money will be split 13 ways. they therefore want each booking to be made to go to the next villa. for example:

if i make a booking, i will be in villa1, i want the next booking to be in villa 2 and then villa 3 and so on.
do u know if i can get the system to automate that, so it moves on to the next villa?

ri
Go to the top of the page
 
+
RiaJones
post Nov 27 2003, 04:39 AM
Post #20

New Member
Posts: 18
From: Essex, no jokes



i have a booking form for villas and i am using a calendar to select the date RANGE however, I need it then to select all dates within that range and if possible highlight them on the calendar. does anyone know how?

ri
Go to the top of the page
 
+

2 Pages V   1 2 >
Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 02:36 AM