By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,395 Members | 1,551 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,395 IT Pros & Developers. It's quick & easy.

Newbie on access, best format to capture date for a booking system

100+
P: 108
Im creating a simple database on a tight deadline for a school project.

Its a sports booking facility.

Open Seven days a week where facilitys are booked upto TWO years in advance.
Each facility can be booked in 30min timeslots though one booking can contain 6 30min timeslots (3hrs) aslong as it is 3hrs running straight from the startdate i.e.

21st Dec 2006 09:00
21st Dec 2006 12:00

Rather than just allow the user to manually type the date and use an input mask, or use an active X calender I thought about using drop downs for each element day/month/year/half an hour timeslot (perhaps use dateserial & timeserial??)

Can anyone advise me on a simple routine that would allow me to either allow lookups or validation to ensure they only 30min timeslots could be booked (validating endate is atlleast 30mins greater than startdate) i.e.

21st Dec 2006 09:00
21st Dec 2006 09:30
21st Dec 2006 10:00
22st Dec 2006 10:30

Also would be useful if i could validate the dates were no more than 2yrs in the future too.

Any help would be greatly appreciated
Cheers
Rob W
Nov 23 '06 #1
Share this Question
Share on Google+
2 Replies


NeoPa
Expert Mod 15k+
P: 31,661
TimeSerials.
Not really - they are (the fractional) part of the DateSerial though.
Date/Time literals can be entered as surrounded by '#'s.
So, you can check that [EndDate]-[StartDate] Between #0:30:00# And #3:00:00#.
You can check that the [EndDate]<=DateAdd("y",2,Date()).
Nov 23 '06 #2

100+
P: 108
Ive had a rethink asI didnt properly explain the scenerio:-

* Bookings must take place 2 Weeks in advance from the current date.

* The limit on booking times is no-one can book more than 2 years in advance.

* Bookings are 30minute slots, HOWEVER one booking can contain multiple 30mins slots as long as they are consquetive slots i.e
1/1/2006 08:00 1/1/2006 10:00 is fine,
1/1/2006 08:10 1/1/2006 10:00 isnt fine as must be booked on the hour (00) or halfpast (30)
1/1/2006 08:00 - 09:00 & 1/1/2006 10:00 - 10:30 would be two bookings as there is an empty timeslot.

I was going to use datetime picker for the date, and a combobox (manually typing out time slots) for the start time, though have no idea how I can take these 2 values from the form to populate ONE field Starttime.

Then I would need validation to ensure the End_time is a minum of 30minutes in advance of the start_time
i.e.
1/1/2006 11:00 1/1/2006 08:00 is incorrect as cant be the endtime as the starttime is in the future.

So maybe have 1 datetime picker to pick date (day/month/year)

and 2 combo boxes for time_slot.

Trying to keep it simple as i have relatively no experience of VBA or access.

Thanks and hope this makes some kind of sense.
Nov 23 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.