I figured out the problem and had to redo the reports using one query
instead. Now it works fine with the where clause.
Except for one report (I have several forms with several reports) all work
fine except for this one.
On the requisition form, I also have a Purchase Order subform. I thought
this would be the best way to do this. The user creates a Material
Requisition which has its own autonumber. Then another user uses the
exact
same information to generate a Purchase Order which has a different
autonumber. So I placed a subform that generates a purchase order for
that
Material Requisition only by setting the Cycle to Current Record and Data
Entry to No.
It works great until I try to print the report from the form. I can't use
the where clause, because the subform is on the form and when I use the
filter query, then it prompts me for the Material Requisition Number and
prints a blank report.
I hope this makes sense.
Thank you.
Duane Hookom said:
What is the exact parameter prompt? Is it "requisition number" or
"materialrequisitionnumber"?
--
Duane Hookom
MS Access MVP
I have no idea why it keeps prompting me.
When I was using the filter query, it would not prompt me but would
print
all requisitions entered. When it prompts me to enter the requisition
number
with the where clause and I enter the one I wish to print, it prints
all
of
them. If I don't enter a requisition number and just click OK, it
prints
blank requisition reports for each one.
It does not prompt me when I open the report and never has. That's
what I
don't understand.
I hope you can help.
Thanks again.
:
Ok, why would running your report prompt for "requisition number" when
this
isn't included in your where clause? Do you get the prompt if you
attempt
to
open the report from the database window?
--
Duane Hookom
MS Access MVP
Yes, I double checked and I do.
:
Confirm that you have a numeric field in your report's record named
"MaterialRequisitionNumber" and a control on your form named
"MatericalRequistionNumber".
--
Duane Hookom
MS Access MVP
I tried it and it still prompts me to enter the requisition
number.
Even
if
I enter the requisition number, it will still print all
requisitions.
I have no idea why it won't print the current one only.
Thank you.
:
I haven't ever used the query argument of DoCmd.OpenReport and
haven't
seen
others recommend it. The method I use is like:
Dim strWhere as String
strWhere = "MaterialRequisitionNumber = " &
Me.MaterialRequisitionNumber
strDocName = "Requisition"
'Print Requisition Report using the where clause
DoCmd.OpenReport strDocName, acViewNormal, ,strWhere
--
Duane Hookom
MS Access MVP
Thank you,
That was not exactly it, but from your answer I was able to
figure
out
what
was wrong.
Now I have another printing problem.
When I click on the print requisition button from the form, it
prompts
for
the requisition number with a dialog box: "Enter Parameter
Value"
and
I
don't know why. I have a filter to print the requisition as
follows:
SELECT Requisition.*
FROM Requisition
WHERE
(((Requisition.MaterialRequisitionNumber)=[Forms]![Requisition]![MaterialRequisitionNumber]));
And in the event procedure I have the following:
Dim strDocName As String
strDocName = "Requisition"
'Print Requisition Report using Requisition Filter Query
DoCmd.OpenReport strDocName, acViewNormal, "Requisition
Filter"
I don't want it to prompt for the number, just to print the
current
requisition on the form and I can't figure out why it is not
doing
this.
Thank you.
:
Since each requisition has it's own number try putting a text
box
in a
group
header section and used the record number as the source. Set
the
properties
to break after section which will put each record on a
separate
page.
If
your
subreport is in the details section it should carry with the
requisition
number for each page.
HTH
scruffy
:
The record source is from a table of the same name, the
subform
is
an
auto-lookup from a query.
I am using a filter as follows:
Dim strDocName As String
strDocName = "Requisition"
'Print Requisition Report using Requisition Filter
Query
DoCmd.OpenReport strDocName, acViewNormal, "Requisition
Filter
Query"
Where clause for the filter is as follows:
WHERE
((([Requisition].[MaterialRequisitionNumber])=[Forms]![Requisition]![MaterialRequisitionNumber]));
Hope this helps - I still can't figure out what is wrong.
Thank you.
:
The recordsource and any filtering and/or where clauses
would
be
helpful -
as it stands we have no way of knowing what the actual
data
being
pulled
might be...
--
hth,
SusanV
message
I have a requisition form that needs to generate it's
own
individual
report.
I have tried everything and can't figure out why the
report
shows
all
requisitions entered instead of a single report for
each
requisition. All
requisitions print continuously on one single report.
The requisition has an auto number with a subform for
the
requisition
details that has an auto-lookup based on a query.
I hope someone has the answer!
Thank you.