Printing report on access

D

David

hi!

i got problem printing report on access. When i try to print only one
report(the one that i've opened) the rest of the previous reports in the
entire database was printed out. How can i print only the one that i'm seeing
and not the entire database? Thks!
 
F

fredg

hi!

i got problem printing report on access. When i try to print only one
report(the one that i've opened) the rest of the previous reports in the
entire database was printed out. How can i print only the one that i'm seeing
and not the entire database? Thks!

You do mean the record you are seeing on a form, don't you?

Each record should have a unique prime key field that identifies that
particular record.

Add a command button to the form.

If the unique field is a Number datatype...
In the Command button click event write:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
Me![RecordID]

If the Unique field is a Text datatype...

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = '" &
Me![RecordID] & "'"

Change [RecordID] to whatever the actual name is of your unique Prime
key field.
 
D

David

Thks!

fredg said:
hi!

i got problem printing report on access. When i try to print only one
report(the one that i've opened) the rest of the previous reports in the
entire database was printed out. How can i print only the one that i'm seeing
and not the entire database? Thks!

You do mean the record you are seeing on a form, don't you?

Each record should have a unique prime key field that identifies that
particular record.

Add a command button to the form.

If the unique field is a Number datatype...
In the Command button click event write:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
Me![RecordID]

If the Unique field is a Text datatype...

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = '" &
Me![RecordID] & "'"

Change [RecordID] to whatever the actual name is of your unique Prime
key field.
 
Top