On Wed, 25 Jun 2008 11:55:01 -0700, Dan @BCBS wrote:
I had tried that, which made it more fustrating but I figured out why I was
getting multi prints. The Report has code in the text boxes like
IIf([CA]="IR","Comm"
So, if there were multiple records that fit this statement, they all printed.
Question: Can I somehow use the MAX statement in the below code to get the
most current record based on a date?
Something like: stLinkCriteria = "[ICNNO]=" & "'" & ICNNO &
"'","MAX[DateEntered]"
stDocName = "r_LetterAck1"
stLinkCriteria = "[ICNNO]=" & "'" & ICNNO & "'"
stLinkCriteria = "[ICNNO]='" & ICNNO & "'"
DoCmd.OpenReport stDocName, acPrint, , stLinkCriteria
Thanks
:
On Tue, 24 Jun 2008 06:53:07 -0700, Dan @BCBS wrote:
Really thought I'd find a thread for this issue but I don't see any.
Why is it printing twice?
This is my command statement to a button as you can see I have an acProview,
acPrint and PrintOut (acPreview works fine) but when I try either of the
other two I get multiple prints? Any suggestions??
stLinkCriteria = "[ICNNO]=" & "'" & ICNNO & "'"
'DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
'DoCmd.OpenReport stDocName, acPrint, , stLinkCriteria
DoCmd.PrintOut
Assuming your criterai is valid (i.e. [ICNNO] is a text datatype), if
all you wish to do is print the report once, all you need is:
stDocName = "SomeReport"
stLinkCriteria = "[ICNNO]='" & ICNNO & "'"
DoCmd.OpenReport stDocName, , , stLinkCriteria
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
I assume you mean the maximum date for that [ICNNO] being displayed on
the form, not the maximum date of all the records in the table.
stLinkCriteria = "[ICNNO]='" & [ICNNO] & "' And [DateEntered] =#" &
DMax("[DateEntered]","YourTableName","[ICNNO] = '" & [ICNNO] & "'") &
"#"
DoCmd.OpenReport stDocName, , , stLinkCriteria
Replace "YourTableName" with the actual name of the table.