Reports not printing data, it prints controls only.

talktime

Registered User.
Local time
Today, 01:53
Joined
Oct 9, 2011
Messages
11
Hi All
i m a newbie to access VBA, i want to print the current record from a form, i managed to do the coding for printing current record but

when i print the button on the form it shows print preview of the current record but with no data, only controls on the reports shows not actual data. plz answer i need it.

sorry for my bad English.

i have attached the data base.
 

Attachments

Hello talktime
Change Your Print Button code:

On Error GoTo Err_Print_Click
Dim stDocName As String
DoCmd.Close
stDocName = "MyReport"
DoCmd.OpenReport stDocName, acNormal 'Change acNormal to acPreview if you want to preview the report first
Exit_Print_Click:
Exit Sub
Err_Print_Click:
MsgBox Err.Description
Resume Exit_Print_Click
 
@talktime: Did you use the Report Wizard to create your report? If you didn't you should use it.
 
In the Print event you need to specify which item to print. Try this:

Code:
DoCmd.OpenReport "MyReport", acViewPreview, , "[SNo]= " & Me.lngPropertyID
 

Users who are viewing this thread

Back
Top Bottom