Multipul report printing- Please help newbee

T

terry

I have several reports that are printed from the form by using the following
code
Example
Private Sub Command209_Click()
Dim strDocName As String
Dim StrWhere As String
strDocName = "InFullLtr"
StrWhere = "[FDMS]=""" & Me!FDMS & """"
DoCmd.OpenReport strDocName, acPreview, , StrWhere


End Sub

This works great for printing the current record only and this report only.

FDMS is the identifer I uses on the report (unique Number) what I would like
to do is be able to print multipul reports at the same time. some of the
other reports are FlowerRoom, PaidInFull,Effects.

I made a post earlier in the New user and was instructed to make a list box
with multi select however The option to list reports was not one of the
options, it had field list , or table .

Below is a sample of the code I was to use

Example:
Dim StrWhere As String
StrWhere = "[FDMS]=""" & Me!FDMS & """"
Dim VarItm As String
For Each VarItm In MyCtl.ItemsSelected
DoCmd.OpenReport MyCtl.ItemData(VarItm), acPreview
Next

Receive a error each control variable must be varient or object
 
D

Douglas J. Steele

The message is trying to tell you that

Dim VarItm As String

should be

Dim VarItm As Variant

Of course, to do what you want, you'll also need to change

DoCmd.OpenReport MyCtl.ItemData(VarItm), acPreview

to

DoCmd.OpenReport MyCtl.ItemData(VarItm), acPreview, , StrWhere
 

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