Print Records selected

MartijnAn

Registered User.
Local time
Today, 13:59
Joined
Sep 30, 2004
Messages
51
Hi All, I found this code in another Topic:
IMO said:
DoCmd.OpenReport "YourReportName", acViewPreview, Forms![YourFormName]![Me!PrintSelect] = True

Not forgetting to change "YourReportName" and "YourFormName" to their correct Names.

I think that should do it. Let me know how you get on.

IMO

Now, the code does work but it only prints the last record which is selected, not all the records I have selected. Does anyone know what could be wrong?

Thanks.
 
Not enough information.

How are you selecting records? On a form? In a listbox? In a datasheet?
 
tkpstock said:
Not enough information.

How are you selecting records? On a form? In a listbox? In a datasheet?
Oh sorry, in a form. The checkboxes are in front of each record.
 
Are the checkboxes boolean (yes/no) values in the record itself? Are the records in a listbox and checkboxes outside the listbox? It might help if you attach a screenshot.
 
tkpstock said:
Are the checkboxes boolean (yes/no) values in the record itself? Are the records in a listbox and checkboxes outside the listbox? It might help if you attach a screenshot.
Does this help?
 

Attachments

  • prscrn.JPG
    prscrn.JPG
    29.2 KB · Views: 154
What it appears is that you have a continuous form - are the checkboxes a field in your table that the form is linked to, or just an unbound checkbox?

If they are bound to a field in the table, you could then pass the recordset to the report:

Code:
DoCmd.OpenReport "YourReportName", acViewPreview, , "[Field] = True"
 

Users who are viewing this thread

Back
Top Bottom