Report generated but prompts for parameter when printing

T

teddysnips

I have been asked to look at an Access application. It generates a
report successfully, so that you can see it on the screen with no
errors.

However, when you try to print it, the prompt dialog for missing
parameter is displayed.

Anyone any thoughts?

Sorry it's rather sort on detail, but I've been passed the details of
the problem by someone else. I'm expected to sort the problem on a
site visit and I don't know if I'll have Internet access on-site.

TIA

Edward
 
A

Arvin Meyer [MVP]

Unfortunately, without much more information, the problem could be in many
different places. Here are a couple of the more likely ones. First run the
query and see if you get prompt. Then look in the Sorting and Grouping
dialog and see if there are any fields which are no longer in the data set.
 
B

BerkshireGuy

Wouldn't those conditions hold true even in preview mode?

How do you print the report? Via the print icon in Access or did you
code an option to print or preview? If so, perhaps there is a bad
where clause being passed when you choose print?

-Brian
 
T

teddysnips

BerkshireGuy said:
Wouldn't those conditions hold true even in preview mode?

How do you print the report? Via the print icon in Access or did you
code an option to print or preview? If so, perhaps there is a bad
where clause being passed when you choose print?

-Brian

That's what I thought. Obviously I'll take a look at Arvin's
suggestions, but my thinking (bearing in mind that I *didn't* write the
app., and in fact have never seen it!) is that if it gets as far as
generating the report on screen it's unlikely to be a problem with the
underlying query.

I'll post again when I've figured it out, or have more information.

Edward
 
P

paii, Ron

Does the report contain a graph?

I have one with a parameter in the graph's source query that accepts my
input before the preview and repeats the prompt when printed.
 
T

teddysnips

Ignore what I wrote - the person who relayed the problem details was
misled.

The problem comes, as I suspected, when the report is actually being
generated on-screen. As Brian suggested, the report is being "Printed"
via a button, which simply opens the report.

The report contains a number of sub-reports, one of which contains a
text box with the following ControlSource:

=(Str([Quantity]))+(" no. "+[CutOutDescription])

When opening the report, the parameter would prompt for "Str"

This led me to think that there was either a References problem or a
Compilation problem. The References checked out, but the program
didn't compile. It barfed in the following sub:

Private Sub Text28_AfterUpdate()

Dim stDocName As String

stDocName = "qryEstimateTotals"
DoCmd.Requery stDocName, acNormal, acEdit

End Sub

The offending line is:

DoCmd.Requery stDocName, acNormal, acEdit

and the error is:

"Wrong number of arguments or invalid property assignment"

If I amend the line to:

DoCmd.Requery stDocName

all is well - the application compiles and doesn't prompt for a
parameter called Str!

What I want to know is:

How did anyone ever get the damn thing to work in the first place?
Please do bear in mind that I DID NOT write this - for a start, I never
leave my controls with their default names (e.g. Text28) And what is
the purpose, do you suppose, of the line

DoCmd.Requery stDocName, acNormal, acEdit

Thanks

Edward
 

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