Print 3 almost the same reports for one record......

ok well ill just come with the lap top at 5 at your work! If you are sure thats ok with you!:) Thanks honey!
 
Not sure what you've done wrong when print 3 reports

See attached db as example

Smed
 

Attachments

oh what a star!! Ill give that a shot just now and ill let you know ow i get on!!:)
 
ok well i am kind of getting what i want!

what i am getting is a pharmacy,case notes and 2 gp copies for ref:21 when i am working on ref:22 then im getting a gp copy for ref:22

so im getting 5 sheets of paper out the printer when i press print...i only want 3
i am getting the 3 copys for the previous record plus an extra GP one and 1 GP print out for the actual record i want! hummmmm! thats not right!

please help! i looked at the code and its exactly as its supposed to be!:confused:
 
Last edited:
Private Sub PrintScript_Click()
On Error GoTo Err_PrintScript_Click
DoCmd.RunCommand acCmdSaveRecord
Me.fld_ReportTitle = "Pharmacy Copy"
DoCmd.OpenReport "ART", acViewNormal

Me.fld_ReportTitle = "Case Notes Copy"
DoCmd.OpenReport "ART", acViewNormal

Me.fld_ReportTitle = "GP Copy"
DoCmd.OpenReport "ART", acViewNormal

Dim stDocName As String
stDocName = "ART"
DoCmd.OpenReport stDocName, acNormal

Exit_PrintScript_Click:
Exit Sub

Err_PrintScript_Click:
Msgbox Err.Description
Resume Exit_PrintScript_Click

End Sub
 
' only print the current record

Dim filter
filter = "Ref:= Forms!ARTScript!Ref:"
DoCmd.OpenReport "ART", acViewPreview, , filter

ok i put this code into the print script on_click event along with the other code i have posted and it still doesnt work!

Private Sub PrintScript_Click()
On Error GoTo Err_PrintScript_Click

DoCmd.RunCommand acCmdSaveRecord

' only print the current record

Dim filter
filter = "Ref:= Forms!ARTScript!Ref:"
DoCmd.OpenReport "ART", acViewPreview, , filter

'print the record with three headings

Me.fld_ReportTitle = "Pharmacy Copy"
DoCmd.OpenReport "ART", acViewNormal

Me.fld_ReportTitle = "Case Notes Copy"
DoCmd.OpenReport "ART", acViewNormal

Me.fld_ReportTitle = "GP Copy"
DoCmd.OpenReport "ART", acViewNormal

Exit_PrintScript_Click:
Exit Sub

Err_PrintScript_Click:
Msgbox Err.Description
Resume Exit_PrintScript_Click

End Sub

please help me as i just cant see whats going on!someone else may see a little mistake thats soo clear but i just cant see it!
 
Lynsey,

I think I have found your problem.

The recourd source of your ART report was specified in such as way that a cascading effect was being created due to the filtering with the report.

Instead of using the filter option in the report, change the record source of the report into an SQL statement. Copy and paste the following into record source of the report:


SELECT ARTScriptmaster.* FROM ARTScriptmaster WHERE ((([ARTScriptmaster].[Ref:])=[Forms]![ARTScript]![Ref:]));


Now in the ARTScript form, remove the following section of code as it does not work properly.


' only print the current record
Dim filter
filter = "Ref:= Forms!ARTScript!Ref:"
DoCmd.OpenReport "ART", acViewPreview, , filter


HTH, any more problems don't hesitate to ask

Smed
 
Thank you ill give that a try just now, is that going to stop the problem with the error message too? in fact i think i posted the error message in the other one by mistake.
 

Users who are viewing this thread

Back
Top Bottom