View Full Version : Print Report


McDonald
03-26-2009, 05:50 AM
Dear,

I have a Table with hundreds records. I create a Form and a Report Template to link with this Table. I input a new record from this Form and try to print it out.

But my problem is I can't print the on-screen record. It will print all the records in my Table. Pls advise how I can only print the on-screen records. Thanks so much

B. regards,
Donald

pbaldy
03-26-2009, 08:25 AM
This technique, but with OpenReport:

http://www.baldyweb.com/wherecondition.htm

McDonald
03-30-2009, 02:01 AM
i'm not so good on vb, and there is some other steps need to run. so can i use marco > openreport and add the statement on the condition field. But i don't know how to write this statment. Pls advise. Thanks

pbaldy
03-30-2009, 12:19 PM
I don't use macros, but yes, you can use the condition. I believe it would look like the last part of what I posted, though you would need the full form reference instead of Me.

McDonald
03-30-2009, 04:53 PM
it's work. thanks so much

rio
03-30-2009, 09:59 PM
i have a question 2.. i used this code to save my report in folder with specific name.

Private Sub cmdKR_Click()
Dim dtkr As String
Dim filepath As String
Dim filename As String
Dim strTemplateLocation As String
filepath = DLookup("[lokasi]", "LokasiFailIP")
filename = DLookup("[Nama Fail]", "NamaFailIP")
' Specify location of template
strTemplateLocation = filepath & "\" & "Keterangan" & filename & ".doc"

dtkr = ("[DataKR.NoPendaftaran]=" & "'" & Me.NoPendaftarantxt.Column(0) & "'")
DoCmd.OpenReport "rptKRKesalahan", acViewPreview, , dtkr
DoCmd.OutputTo acOutputReport, "rptKRKesalahan", acFormatRTF, strTemplateLocation
End Sub
when i click the button..... the file save and report preview also open. what should I do if I don't want that report to preview.

rio
04-01-2009, 03:48 PM
tq.. I'm get the answer.