PC Bookings System

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi - I'm trying to develop a PC Bookings System. Users will be able to book a
PC for either 30 minutes, 60 minutes, 9 minutes, or 120 minutes. Does anyone
know how tis can be achieved in Access? - Many thanks
 
Charlie,

The answer is yes, many people here know how to do it. You can't expect
to be told how though! This is too general a question to be answered
here, the answer would be way too extensive.
These newsgroups are for asking and getting help on specific questions.
Once you get started, you can come back with specific questions and get
some answers.
If, on the other hand, your Access skills are not sufficient to get you
started, then I would advise you either seek a ready solution or someone
to tailor it for you, if you are pressed for time, or get a good book on
Access and start reading.

Regards,
Nikos
 
Charlie Bennett said:
Hi - I'm trying to develop a PC Bookings System. Users will be able to
book a
PC for either 30 minutes, 60 minutes, 9 minutes, or 120 minutes. Does
anyone
know how tis can be achieved in Access? - Many thanks


You might want to start with the Resource Scheduling template that comes
with Access. File, New, On My Computer link, and then the Databases Tab.
 
Well, I can certainly give you some good tips here:

First, use a date+time field for your booking table.

Further, using a startDate+Time field,
and
use a EndDate+Time field.

So, have a field for the start of the booking, and the end time of the
booking The fact that you only have 30-120 minutes here is really moot. With
a start and end time, you can have any amount of time you wish. You can
certainly restrict the booking times to 30 minute increments, but that is
only a choice that you RESTRICT the user to, not some HARD coded part of
your design.

The beauty of the above is that you can use the VERY simply formula to find
a booking collision.

So, the trick in a booking system is to only store the start and end date of
the
booking.


And, to prevent collisions, the logic here is quite simple:


A collision occurs when:


RequestStartDate <= EndDate
and
RequestEndDate >= StartDate


The above is thus a rather simply query, but if any collision occurs, the
above will return records..and you simply don't allow the booking. In other
words, since we NEVER allow booking with a collision, then the above simply
statement will work for us.


dim strWhere as string
dim dtRequeestStartDate as date
dim dtRequestEndDate as date


dtRequestStartDate = inputbox("Enter start Date")
dtRequestEndDate = inputbox("Enter end date")


strWhere="#" & format(dtRequestStartDate,"mm/­dd/yyyy") & "# <= EndDate" & _
" and #" & format(dtRequestEndDate,"mm/dd­/yyyy") & "# >= StartDate"


if dcount("*","tableBooking",strW­here) > 0 then
msgbox "sorry, you can't book
....bla bla bla....


The above is just an example, and I am sure you would build a nice form that
prompts the user for the booking dates. However, what is nice here is that
the simple conditions above does return ANY collision. Your form will
simply ask for the time, but you also must specify a date. If you make
the above conditions include the date+time, then the above will
still work for your needs...
 
Back
Top