Report prompts for parameter when opened by DoCmd

D

dgmoore

I have an Access03 report that prompts for a parameter when opened by
DoCmd.OpenReport, but not when opened manually in the database window.

The field that is being prompted for is not used anywhere in the
report, but it is in the report's query, with criteria [fieldname] Is
Null.

Does anybody have any suggestions?

Thanks
Dave
 
L

Larry Linson

I have an Access03 report that prompts for a
parameter when opened by DoCmd.OpenReport,
but not when opened manually in the database window.

The field that is being prompted for is not used
anywhere in the report, but it is in the report's query,
with criteria [fieldname] Is Null.

Does anybody have any suggestions?

Reporting is "smart" enough that it "helps you out" by removing from the
RecordSource any fields not actually used in the Report... that's possibly
what is happening here. If so, putting a TextBox on the Report bound to that
Field, and setting the Text Box's Visible property to No or False so it will
not be seen, may fix the problem.

Larry Linson
Microsoft Access MVP
 
D

dgmoore

You gotta love the "help" Access provides! I tried your suggestion and
it worked -
Thanks for the tip.

Dave


Larry said:
I have an Access03 report that prompts for a
parameter when opened by DoCmd.OpenReport,
but not when opened manually in the database window.

The field that is being prompted for is not used
anywhere in the report, but it is in the report's query,
with criteria [fieldname] Is Null.

Does anybody have any suggestions?

Reporting is "smart" enough that it "helps you out" by removing from the
RecordSource any fields not actually used in the Report... that's possibly
what is happening here. If so, putting a TextBox on the Report bound to that
Field, and setting the Text Box's Visible property to No or False so it will
not be seen, may fix the problem.

Larry Linson
Microsoft Access MVP
 

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