Screen Report differs from Print Report

  • Thread starter Thread starter sgross
  • Start date Start date
S

sgross

I've created a form in Access 2003 that uses the Calendar Control. It
grabs a date, then on a Button Click event, the following line is
executed:

DoCmd.OpenReport "Report X", acViewPreview

The report correctly displays the passed Date value. The problem is
that when I print the report, the passed Date value shows up as
#Name?, which means no value was passed.

However, when I change the code to:

DoCmd.OpenReport "Report X", acViewNormal

then the report goes directly to the printer with the correct passed
date value, but I no longer get a screen preview.

So how do I get both the screen view and the printout to both display
the correct date value?
 
I've created a form in Access 2003 that uses the Calendar Control. It
grabs a date, then on a Button Click event, the following line is
executed:

DoCmd.OpenReport "Report X", acViewPreview

The report correctly displays the passed Date value. The problem is
that when I print the report, the passed Date value shows up as
#Name?, which means no value was passed.

However, when I change the code to:

DoCmd.OpenReport "Report X", acViewNormal

then the report goes directly to the printer with the correct passed
date value, but I no longer get a screen preview.

So how do I get both the screen view and the printout to both display
the correct date value?

Answered elsewhere.
Please do not multi-post. If you feel you must post the same question
to more than one newsgroup (and it's seldom necessary), cross-post by
adding each additional newsgroup in the To Newsgroups: box, separated
by a comma.
This way an answer in one newsgroup will be seen in each of the
others. More readers will see the response and learn, and less time
will be spent on duplicate answers.

See Netiquette at http://www.mvps.org/access

It's a great site to visit anyway.
 
Back
Top