English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Fields are as followed:
1) Date Booked for
2) Start Time
3) End Time

Thanks in advance for any help

2007-03-19 23:08:30 · 3 answers · asked by minimes2003 1 in Computers & Internet Programming & Design

3 answers

First thing is to check for the date.
If that equals date of pending booking do check on times
And you've got to loop through all the bookings you already made. Mabye do a check on inputting start and end times so that start is less then end.
sub checking()
For every record in your file 'do while not .eof. ?
if date = bookingdate then
if starttime < pending booking time start then
if endtime < pending booking time start then
bookable = true 'bookable is a boolean variable
else
bookable = false
goto notbookable
endif
else
if startime > pending booktime start then
if starttime > pending booktime end then
bookable = true
else
bookable = false
goto notbookable
endif
else
bookable = false
goto notbookable
endif
endif
else
msgbox "booking can be made"
exit sub
endif
next record
:notbookable
msgbox "booking can't be made"
end sub
With some tweaking this will loop every record in your file. If bookable is still true then booking can be made. If bookable becomes false the loop will exit and message will show up that booking can not be made.

Test a little before implementing.

2007-03-19 23:36:22 · answer #1 · answered by Charlie 1 · 1 0

ur question is not clear, but i think it is related to "query" in MS Access

2007-03-19 23:29:22 · answer #2 · answered by abd 5 · 0 0

could u explain more

2007-03-19 23:21:53 · answer #3 · answered by eng_shoushou 2 · 0 1

fedest.com, questions and answers