Print report, pass multiple critera

Y

Yogi_Bear_79

Sorry apparently I hit a keyboard shortcut and sent before I was done
typing.

Here is an excerpt of my sql statement, than my report is generated from.

WHERE (((tblEZPassTolls.TransactionDate) Between [Start Date] And [End
Date]) AND ((tblPersonnel.IDSA)=[ID?]));

The Query has thre critera required to make it run. How do I edit the
following to pass all three critera from VBA

DoCmd.OpenReport "rptFullFromID", acViewNormal, ,

I intend on haveing VBA ask the user for the start/end dates and it auto
generates the ID critera Each of these values will be held in a variable.
For simplicity just call them A, B, C


Ideally this function would print to my Adobe PDF writer. I have code to
change my default printer to ADOBE for this taks and then back again. Unless
there is a better way, also i still need to find out how to name the file
when it prints to Adobe
 
D

Douglas J. Steele

Unfortunately, I don't believe you can, because of the report. If you were
strictly trying to open the query, you'd be able to use the Parameters
collection.

You could create a form that has the 3 values on it, and have the underlying
query refer to those fields (You'd have Forms!MyInputForm!StartDateValue
instead of [Start Date] for instance). The form doesn't even have to be
visible, so your users wouldn't even have to know about it.
 
Y

Yogi_Bear_79

A form wouldn't be bad, because currently I am strcitly working with a
back-end. Which means since I am the only one who knows how it works I also
have to use it :(

I'll try and build a form to supply two of the three variables, the start &
end date, the ID is randomly generated via VB code at the time of the
report. Basically we are running a random report on 5 users.


Douglas J. Steele said:
Unfortunately, I don't believe you can, because of the report. If you were
strictly trying to open the query, you'd be able to use the Parameters
collection.

You could create a form that has the 3 values on it, and have the
underlying query refer to those fields (You'd have
Forms!MyInputForm!StartDateValue instead of [Start Date] for instance).
The form doesn't even have to be visible, so your users wouldn't even have
to know about it.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Yogi_Bear_79 said:
Sorry apparently I hit a keyboard shortcut and sent before I was done
typing.

Here is an excerpt of my sql statement, than my report is generated from.

WHERE (((tblEZPassTolls.TransactionDate) Between [Start Date] And [End
Date]) AND ((tblPersonnel.IDSA)=[ID?]));

The Query has thre critera required to make it run. How do I edit the
following to pass all three critera from VBA

DoCmd.OpenReport "rptFullFromID", acViewNormal, ,

I intend on haveing VBA ask the user for the start/end dates and it auto
generates the ID critera Each of these values will be held in a
variable. For simplicity just call them A, B, C


Ideally this function would print to my Adobe PDF writer. I have code to
change my default printer to ADOBE for this taks and then back again.
Unless there is a better way, also i still need to find out how to name
the file when it prints to Adobe
 

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