Setting dates in criteria

J

John P

I have a database set up to record usage of different
items of equipment in a laboratory and calculate costs for
the equipment use. The user inputs usage data into
specific tables for each piece of equipment using forms. I
need to extract the cost data and am using a query that
uses several subqueries (one for each piece of equipment)
to sum costs incurred to different charge codes. Each
subquery selects data from a different table for a
specific month. At present the required month has to be
manually entered into the criteria of each subquery, which
is very tedious.

I would like to be able to enter the month or date range
just once (globally), so that each subquery criteria then
holds the required month to use. There is probably an easy
way to do this but I do not have a lot of experience with
Access. I would appreciate any help that anyone can offer
on this.

Thanks,
John P
 
D

Dale Fye

John,

I think I answered this yesterday:

1. Create a form.
2. Put a combo box on the form for the user to select a month
3. Modify each of your queries so that they reference the control on
your form rather than a parameter. Now, when you run the query, each
sub-query will refer to the value you selected on your form.
4. Put a command button on the form that runs the query


--
HTH

Dale Fye


I have a database set up to record usage of different
items of equipment in a laboratory and calculate costs for
the equipment use. The user inputs usage data into
specific tables for each piece of equipment using forms. I
need to extract the cost data and am using a query that
uses several subqueries (one for each piece of equipment)
to sum costs incurred to different charge codes. Each
subquery selects data from a different table for a
specific month. At present the required month has to be
manually entered into the criteria of each subquery, which
is very tedious.

I would like to be able to enter the month or date range
just once (globally), so that each subquery criteria then
holds the required month to use. There is probably an easy
way to do this but I do not have a lot of experience with
Access. I would appreciate any help that anyone can offer
on this.

Thanks,
John P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top