Validation

Sisko

New member
Local time
Today, 10:59
Joined
Nov 26, 2006
Messages
8
Is there a way to set up validation so that:

1: The system will not allow a car already hired, to be hired out again

I have a loans form, but i've noticed that, it lets me hire out any car, even cars that are already hired out.

any tips on how to set up the correct validation?

cheers guys
 
presumably your loans form has a start date and an end date. You could remove the car from the selection list between those dates.

How do you select cars?

Col
 
When a customer wants to take out a car, a car is chosen by its registration number, nothing else. Each car has a hire date, and a due date for when the car is due back.

I need my validation to be set up so that, when a car is already hired out, that car registration number is removed from the list of avaliable cars for hire.....or, an error message gets displayed telling the user the car is already hired out.

cheers for your input, keep it coming :)
 
Last edited:
so in the query behind the list of cars you need to put in the criteria to exclude any car where todays date is between the start and end date.

Col
 
ColinEssex said:
so in the query behind the list of cars you need to put in the criteria to exclude any car where todays date is between the start and end date.

Col

and that will prevent the system from allowing cars that are already hired, from being "hired" out again?? :)
 
Sisko said:
and that will prevent the system from allowing cars that are already hired, from being "hired" out again?? :)


One thing, are you saying then that I will need a query, like an update query in order for this to work?
 
If you exclude them from the list, presumably they can't then be picked until after the end date.

Or another way is when a car is hired out, a flag is attached to the car record and removed when the car returns. So therefore you exclude everything with a (active) flag

Is there no indication as to what make / model of car? just picking from a reg number seems somewhat random

Col
 
Sisko said:
One thing, are you saying then that I will need a query, like an update query in order for this to work?
No. Use the query that generates your list of cars.

Col
 
ColinEssex said:
If you exclude them from the list, presumably they can't then be picked until after the end date.

Or another way is when a car is hired out, a flag is attached to the car record and removed when the car returns. So therefore you exclude everything with a (active) flag

Is there no indication as to what make / model of car? just picking from a reg number seems somewhat random

Col

Yeah, i know its random. lol. but i think it saves hassle from having to fiddle around with other things.

Say, if I hire a car out on the 15/06/06, and its due back on the 20/06/06, what would you recommend would be a suitible criteria to input into a query to remove/exclude that car as a choice from the loans form?
 
Add the start date and the end date in the query.

Then under the start date put
Code:
<Date()

and under the End Date put
Code:
>Date()

That'll include only cars that are not hired out today

Col
 

Users who are viewing this thread

Back
Top Bottom