RE: Report Parameters
- From: Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 13 Dec 2007 13:16:01 -0800
If there are multiple subreports that need the dates, then each will have to
prompt for the dates. I know of no other way to do this for multiple sub
reports.
If only one subreport needs dates, then you can cause it to prompt for the
dates like this:
SELECT Feild1, Field2, Field3 FROM MyTable WHERE Field3 Between
[Enter StartDate] AND [Enter EndDate];
When the query runs, it will pop up an input box with Enter Start Date and
another for EndDate, but since each subreport has it's own query, each query
will have to get the date. If you use the dates on the form as I suggested,
there will be no prompts.
--
Dave Hargis, Microsoft Access MVP
"TotallyConfused" wrote:
Is there another way to do this without having to put text boxes on my form?.
My main form has a subform. Main form consists of doctor info. Subform
lists pts assoc with doc. When I call the main report from main form it
generates the sub reports of pt info. There can be 1 to 6 different
subreports assoc with any one doc. There can be several instances of one
particular sub report that need start and end dates specific to the pts. ex:
Rpt 1, Rpt 2, Rpt 3 - Rpt 2 could be called twice with 2 different pts.
Need report to prompt twice. So is there any other way to do this? Thank
you - your help is very much appreciated as I am not proficient in Access or
code.
"Klatuu" wrote:
I meant the record source of the subreport.
Put text boxes on your form to enter the dates and reference the text boxes
in the query
SELECT Feild1, Field2, Field3 FROM MyTable WHERE Field3 Between
Forms!MyForm!txtStartDate AND Forms!MyForm!txtEndDate;
Note I corrected my syntax from the previous post.
--
Dave Hargis, Microsoft Access MVP
"TotallyConfused" wrote:
I do have a query for the recordsource of my report which pull all types of
this report. However, These dates that I enter are not dates that I need to
store in my database. They are needed only when calling report in order to
print report with these dates. So where would I put the info you provided?
Thank you
"Klatuu" wrote:
In that case, you can have a query for the recordsource of the subreport that
filters based on the values of the text fields on the report:
SELECT Feild1, Field2, Field3 FROM MyTable WHERE Field3 Between
Forms!MForm!txtStartDate AND txtEndDate;
--
Dave Hargis, Microsoft Access MVP
"TotallyConfused" wrote:
Thank you for responding. I am sorry for not being more specific.
This is my situation. I have one main report and several sub reports. This
particular sub report is the one with dates that need to be entered before
printing. Therefore, on my report depending on specific provider when I
click on command button it calls the main report within the main report there
are different subreports. It is in one of the subreports where I need to
promt for dates? How do I do this. Can you provide sample? Thank you again.
"Klatuu" wrote:
You should not have to have any prompts. If you run the report from a form,
add controls for each of the dates. Then use the Where argument of the
OpenReport method to filter the records based on the dates. The Where
argument is just like an SQL Where clause. Take the filtering out of your
query.
--
Dave Hargis, Microsoft Access MVP
"TotallyConfused" wrote:
I have a report that promts 3 times asking for dates like: Enter "Start
Date" to "End Date" for different types of dates. Therefore in all it will
prompt the user 6 times. I would like to narrow the prompts to at least 3 if
possible by somehow just prompting once for each instance and getting the
Start Date to End Date in one prompt. How do I do this? Can someone please
help with this. Thank you in advance for any help.
- Follow-Ups:
- RE: Report Parameters
- From: TotallyConfused
- RE: Report Parameters
- References:
- RE: Report Parameters
- From: Klatuu
- RE: Report Parameters
- From: TotallyConfused
- RE: Report Parameters
- From: Klatuu
- RE: Report Parameters
- From: TotallyConfused
- RE: Report Parameters
- Prev by Date: RE: Report Parameters
- Next by Date: Re: =if order received, Highlithing details section in grey
- Previous by thread: RE: Report Parameters
- Next by thread: RE: Report Parameters
- Index(es):