Help please

Pc_Guy

New member
Local time
Today, 11:47
Joined
Mar 26, 2008
Messages
6
Hi Guys,

I’m making a database which is used to hire cars to customers.

What I’m having problems is that I want the user on the application to have a list of all the cars free for a certain date.

I know that if I do in a query I can get the result of free cars. But the problem is can I pass the parameters back into the form for the user to see?

Also, will the query now stop the user from renting a car that is out to another customer? – like a message box will appear saying ‘this car is on loan’

For example Customer 1 has hired car number 1 for the 1/1/08 and will return it on the 2/01/08

Customer 2 wants car 1 for the 1/1/08 and will return on the 2/01/08.

Also, can queries work out calculation in dates? So that it can work out the car is being used for 2 days and will be in the format of 2/01/08?

Cheers for any help.
 
Parameters from a query to a form?? You surely mean the reverse OR you mean the recordset to be shown in a form... Both are possible.

'this car is on loan' will need some coding probably... but doable
Also if you only show available cars, obviously the user cannot pick a car that is 'on loan' allready

Calculating dates... yes... sure... no problem... just add the 2 days to the date and you have Jan 1st + 2 days = ... well... ??

1 + 2 = 3, yes so... Jan 3rd :)

Good luck
You will probably need it to finish the assignment before monday ;)
 
yeah, like the information, however how do you do that? lol, I cant seem to work that out... or is it like a text linked to the query?
 
return date: tbl_hire!First_day_of_hire+tbl_hire!Last_day_of_hire - the code i'm using for the return date however its adding up the whole lot not the first bit :(
 
What are the contents of those two fields???
if...
First day = 01-jan-2008
Last day = 02-jan-2008

And you are adding the two together, yes you get funky results

Get up to speed on queries, running queries, parameters and such... I can help you on harder stuff, but I am not going to do a databases 101 with you on this forum...
 
K, i'm doing internet reading. I've sort got the date working however the year is wrong.

expr1: CDate([First_day_of_hire])+CDate([Last_day_of_hire]) - it'll get the day and month correct just the year not working!
 
K, i'm doing internet reading. I've sort got the date working however the year is wrong.

expr1: CDate([First_day_of_hire])+CDate([Last_day_of_hire]) - it'll get the day and month correct just the year not working!

What are you actually trying to calculate here? Adding two dates together will give you a very large year in the result.
 
Hi, Ok what i'm trying todo in the query is add two dates togethere

so date car hire: 01/01/2008
date care gets returned:02/01/2008
Date car is returned: 3/01/2008 - adding the first two fields.

The day and month is fine just the two years are adding and keep giving 2016!

AND, i cant find anwhere how to link a query information to a form, like, when I run the query I want all the data in there to appear in the form so the user can see what cars are free and what cars are not free and then pick a car from the list.
 
No no no...
so date car hire: 01/01/2008
date car gets returned:02/01/2008
Date car is returned: 3/01/2008
This plain doesnt make sence... Car returned = car returned, meaning Jan 2nd right??? Not Jan 3rd... for peets sake...

OK A little database 101
Go to the forms tab of the database
Click NEW
Click on "tabular"
Select your query in the drop down list
click ok
Go thru the screens given
Presto form made...
<end> Database forms 101
 
No no no...

OK A little database 101
Go to the forms tab of the database
Click NEW
Click on "tabular"
Select your query in the drop down list
click ok
Go thru the screens given
Presto form made...
<end> Database forms 101

:D:D

Just watching this thread gave me a headache
 
Right, I got that... but my quiry not stoping people hiring the same car out to someone WITH the same date.

I'm assuming its an IFF statement I use which looks at the date hired for?
 
No no no...

*ugh*

Your query will be the source of where people can pick cars to be rent out right?
So if your query doesnt display cars that are not available, they cannot pick them either...

Moreso it is IIF not IFF and NO you dont use that... That is what WHERE clauses are for.

*GRMBL*
 

Users who are viewing this thread

Back
Top Bottom