'Enter Parameter Value' dialog wrongly appearing in Access 2000

D

Darren Burns

After converting from access 97 to access 2000 when I try to open some of my
reports from code I get an 'Enter Parameter Value' dialog appearing. There is
no field name listed in the dialog and when I press the OK button the reports
appears just as in Access 97. Is there any way to suppress this dialog from
appearing?
 
A

Allen Browne

This sounds like either a corruption, reference issue, or a name clash.

First thing to do in A2000 and later is to make sure the Name AutoCorrect
boxes are unchecked under:
Tools | Options | General
Explanation of why:
http://allenbrowne.com/bug-03.html
Then compact the database. You may find this is enough to solve the problem.

If the report (or its source query) uses any code or built-in functions, the
issue could be caused by a reference problem. More info:
http://allenbrowne.com/ser-38.html

If the report is based on a query, run the query directly. Does it ask for a
parameter? If so, you can find out more about the parameter by opening the
Immediate Window (Ctrl+G) and asking thing such as:
? CurrentDb.QueryDefs("Query1").Parameters.Count
? CurrentDb.QueryDefs("Query1").Parameters(0).Name

If the query runs without asking for a parameter, then the issue must be in
the report. Is there anything in the Sorting And Grouping box that Access
could misunderstand as a field name? Anything in the report's Filter or
OrderBy properties? Any controls bound to an expression that could be
misunderstood?
 
D

Darren Burns

Hi Allen,

Thanks for you earlier response. Unfortunately I still can't get rid of the
'Enter Parameter value' dialog. The confusing thing is that the reports work
fine in the Access 97 version of the database. I just get the dialog
appearing in the Access 2000 version. Also I thought the 'Enter Parameter
Value' dialog usually gave the name of the field it is expecting but the
dialog that is appearing does not display a field name, just a text box to
type into. Also it does not matter what I type into the dialog, as long as I
press OK the report will appear. Is there any way to suppress the dialog or
pass in a default value or something?
 
A

Allen Browne

To suppress the dialog, we need to track down what's causing it.

Whatever is causing it in A2000, was not causing it in A97, so I suggested 3
possibilities.

Is the report based on a query? How many parameters did the line of code
report?

Is the parameter Name reported as a zero-length string? a space? other?
 
D

Darren Burns

Allen,

What do you mean when you say
"How many parameters did the line of code
report?

Is the parameter Name reported as a zero-length string? a space? other?"

Is there a collection of parameters returned when you open a report? How do
I access them?

Thanks,
 
A

Allen Browne

The 2 lines of code were in my first reply, along with suggestions on what
to do when you determine whether the parameter is coming from the query or
from the report.
 

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