generate report from listbox

rich_bell20

Registered User.
Local time
Today, 14:24
Joined
May 6, 2003
Messages
31
Hi, i'd like to be able to display all contents of a listbox in a report on the click of the button. I'm very new to all of this, I did some research and downloaded some code to allow me to create the listboxes, but im not sure mysetup would allow me to be able to print each one. I'm thinking i may have to create a seperate report for each table ive created, but dont want to! Ive uploaded my .mdb file for anyone who would be so kind as to take a look, many thanks.
 

Attachments

Anything is possible and what you are trying to do is as well I'm sure.

I would be more than happy to modify your sample .mdb to carry out the task but unfortunately it is in Access 2007 format which I currently do not use. If you would be so kind to save and post as Access 2002 then I'll check it out.

Thanks

.
 
Here is the file in 2002 format. Id just like to be able to print out whatever is displayed in the listbox. This is much appreciated, thank you.
 

Attachments

Very sorry for the late response rich_bell20. As I mentioned in the PM to you, I was out of town for a while.

In any case, attached is the Sample DB you had posted with the required code and Report to carry out the task you were seeking (I hope). The code is located withing the OnClick event for the Print button. Now, the code may look somewhat intimidating but really it isn't much. Just a lot of commenting explaining what each line of code is doing.

I have also made some modifications to your existing code within the sample DB to make it more efficient and less congested although you may never know it for all the comments. :) Explanations of these changes are within their respective procedures.

The route I have taken for your particular situation is to create a temporary Table on the fly with a Create Table query (SQL string) and placed the required data from the Form for our Report by way of yet another query. The Insert query. Everything done here, including the Deletion of the temporary Table, is done with SQL statements.

Another way that this could have been done is to simply Delete all the records from the Temp Table before reassigning new records. You choose whichever you like.

The report I created is strictly for the Form you supplied within the sample DB and is bound to the Temporary Table. I had chosen to display the List Contents from the Form in two columns on each page for easy viewing. You can of course change the report to suit your needs.

Again, sorry for the late response. I hope this helps you in some way.

.
 

Attachments

Although this thread appears to be solved there is still a particular item which was brought to my attention via Private Message by this Thread Starter (rich_bell20) which troubles me a wee bit.

A very valid question was asked within that message (shown below) which I was happy to answer and yet again provide the same Sample DB somewhat modified to demonstrate a procedure to carry out the task:

I have another problem if you wouldn't mind letting me pester you with it. Would there be anyway I could check and see if the site was live or not?

The answer of course is.. "Yes" and your Sample DB (modified) shows you how.

Since I have not heard from rich_bell20 since he sent me the PM and he has not responded to mine, and since I had no E-Mail address to return the sample DB to, I decided to add this Post to the thread. Others may also find it beneficial.

Where ever you are rich_bell20, I hope this helps.

.
 

Attachments

Users who are viewing this thread

Back
Top Bottom