Print more then requested

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

Hi All,

I have some code that is supposed to control what document is print. Based on
the Filter below (stLink) it is only supposed to print if the PO# is what is
up on the form. However when I run the code it prints all the POs in the
table even though I have the filter. I have it printing 3 seperate forms all
based on the same filter. Can some one help me please.

Dim stDocNameA As String
Dim stDocNameB As String
Dim stDocNameC As String
Dim stLink As String

stLink = "[PO_NO]=" & "'" & [PO_NO] & "'"

If Me.POPrinted = -1 Then
MsgBox "This PO has already been Printed. " & _
"If you wish to reprint PO, Uncheck PO Printed Box.", _
vbOKOnly, "Purchase Order already printed"
Else

Me.POPrinted = True
Me.POPrintDate = Now()

stDocNameA = "rptPurchaseOrder1_C1"
stDocNameB = "rptPurchaseOrder2_C1"
stDocNameC = "rptPurchaseOrder3_C1"


DoCmd.OpenReport stDocNameA, acNormal, stLink
DoCmd.OpenReport stDocNameB, acNormal, stLink
DoCmd.OpenReport stDocNameC, acNormal, stLink

End If
 
D

Duane Hookom

Try add another comma:
DoCmd.OpenReport stDocNameA, acNormal, , stLink
DoCmd.OpenReport stDocNameB, acNormal, , stLink
DoCmd.OpenReport stDocNameC, acNormal, , stLink
 

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