open in print preview

potts

Registered User.
Local time
Today, 08:08
Joined
Jul 24, 2002
Messages
87
Anyone know the code to open selected report records in print preview based on the highlighted fields in an unbound, multi-select list box?

I have managed to automatically print the selected records, by passing the print-preview section, but this is not what I want to achieve.

Any help would be much appreciated
 
Selecting the records isn't the problem - perhaps I should have been more clear - It's getting the thing to open in print preview
 
Look up the OpenReport statement in Access help to see how to open a report in print preview mode. Use Docmd.OpenReport ... with the right syntax in sublstitution of the last line (DoCmd.OpenQuery ...) in the above-referred code snippet
 
Thanks - I'll give it a shot tonight
:)
 
:confused:
I can now open the report in print preview, but there is no information on it i.e. a blank report, though the results do seem to have bee filtered. Any ideas on why this might be happening?
 
If you are trying to print a SINGLE record, refer to my answer to this post:

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=33115

If you are using a multi-select list box, you will need to build a string containing all the selected items separated by commas. They also need to be surrounded by single quotes if they are text.

then the where clause would look like:

"YourField In(" & somestring & ")"
 
I've got this to work now - thanks - but I now have another issue. Well, issue or two!!

1. Is it possible to insert some code that will print all the records in the listbox?

2. Can you update a yes/no field contained in the underlying table on which the form is built, based on the records you select in the listbox for printing?
 

Users who are viewing this thread

Back
Top Bottom