creating query that runs in a form when i enter two dates in....

imhiya

New member
Local time
Today, 03:59
Joined
Jun 9, 2008
Messages
9
creating query that runs in a form when i enter two dates in that gives possible kennels that arn't in use for them dates.

So i have a booking form with start date of the booking and the end date of the booking, then the kennel number that booking will use. but i want the combo box where you choose which kennel to show only the ones that are avalible between the start and end dates.

how would i make a query to do this, i made one which shows me the kennels avalible for todays date using >date() and <date() but i want the query to get the two dates from that have being entered into the form and display the empty kennels for them dates.

Ty in advance.
 
Simple Software Solutions

Use the syntax

Between [Start Date] And [End Date]


CodeMaster::cool:
 
how do i get it to put the start date in from the form text box and the end date in from the end text box?
 
Simple Software Solutions

The previous thread is correct in his methodology, however, have you thought that you may want to run this query or report from a different form? If you do then how is the query going to know what the dates are when they are actually referring to fields on a form that is closed.

To get around this isssue and make you database more streamlined have a look at the attachment.

CodeMaster::cool:
 

Attachments

i got it to work using,


>=[forms]![Edit Booking]![Start date of booking]

&

>=[forms]![Edit Booking]![End date of booking]


But now i have to make a macro that gets the kennel ids from this query and compares it to a table of kennel ids using another query and then display these. but im not sure how to save the results of the first query.
 
i got it to work using,


>=[forms]![Edit Booking]![Start date of booking]

&

>=[forms]![Edit Booking]![End date of booking]


But now i have to make a macro that gets the kennel ids from this query and compares it to a table of kennel ids using another query and then display these. but im not sure how to save the results of the first query.

well i got to show them by making a simple query but i want it to show the ones that are not in the first query, what criteria would i put in? ive uploaded my db.
 

Attachments

well i got to show them by making a simple query but i want it to show the ones that are not in the first query, what criteria would i put in? ive uploaded my db.


omg i did it using unmatched query wizard in about 15 seconds. >:O! i need to learn alot about access. Thanks people. :]
 

Users who are viewing this thread

Back
Top Bottom