Question on a query

M

mgkaam

I have a database that has a ID's for all my employees. I want to run a
query that asks me what ID I want, than between what date to what date. I
have the date thing down now I just want it to have a custom question of
"What ID" I am looking for to be asked before the date, would I do this in a
query or just a field in a report?

Thanks in advance!

mgkaam
 
M

mscertified

If Access encounters a variable it does not recognize in a query it will
prompt for the value, so all you need is to use a variable that does not
exisit in any table the query refers to and you will be prompted for the
value.
e.g.
SELECT * from TableName WHERE ID = myID AND TableName.Date between
myFromDate and myToDate;
The query will prompt you for myID, myFromDate and myToDate

It's not a very good way of doing it but it will work. Normally, you would
code a form to request the values and run the query.

-Dorian
 
M

mgkaam

Is there just a way to have it reference my ID field when a report first
opens? then it than can ask the date question that my query is based on?
Like a filter or something so that when I click on my report the first thing
it asks is "What id" than the query kicks in and finishes with the date
question. I know I have done this before and there is a simple way to do it
but right now I can't figure it out!

Thanks again!
 

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