Printing report on access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top