Booking too far in advance or too close

AuroX7

Registered User.
Local time
Today, 10:33
Joined
Feb 22, 2006
Messages
44
Hello everyone, if anybody could help me I'd deeply appreciate it.


Booking ID = the time when it is booked over the phone
Hiring ID = the time when the event is to be held

Basically I have to make some booking dates, and use January and February 2006 as test data. My only dilemma is it says that the booking dates must not be booked more than 8 weeks before the hiring, and at least 1 week before it. So if someone wanted to the hiring for 01/01/06, then they wouldn't be able to book before 01/11/05, but before 25/12/05. Can anybody help me? Thanks. I need it so that whatever the hiring date is, the booking date has to be no more than 8 weeks in advance, but 1 week before the hiring.
 
if (Date() + 40 < [Hiring ID] OR Date() + 7 < [Hiring ID] then
'can't book
end if

A proposed reservation shouldn't be booked until it's accepted.
 
Then what,,,

Then what? Do I enter this into the date field or the hiring ID field?
Sorry to be a pain. The code changed red indicating an error of some form... thanks.
 
I suggested several lines of code, which of course cannot be inserted in a field. Insert it on the Hiring ID AfterUpdate event.
 
Sorry I'm confused...
if (Date() + 40 < [Hiring ID] OR Date() + 7 < [Hiring ID] then
'can't book
end if

if (Date() + 40 < [Hiring ID]
What does the 40 represent?

Date() + 7 < [Hiring ID] then
Presumably the 7 means 7 days ie a week a week before the hiring can be made, which makes sense.

However, you've put 'OR' so does this mean I can use either of those?
I need to use both at the same time, so it can't be more than 8 weeks in advance, but at least a week before the hiring. So lets say 8 weeks is 2 months, which is approximatey 60 days. Shouldn't the 40 be 60 instead?

If (Date() + 40 < [Hiring ID]
Then Msgbox "Booking made!", Booking, vbInformation
ElseIf Date() + 7 < [Hiring ID] Then Msgbox "Booking made!", Booking, vbInformation
End If

Would that be correct or no? If the date is at least 7 days before the hiring and no more than 60 days, then it is fine.
 

Users who are viewing this thread

Back
Top Bottom