Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListBox 1

Status
Not open for further replies.

LeafyJellyFish

IS-IT--Management
Oct 9, 2003
7
0
0
US
I would like to make selections from a listbox, have them save to a field, and print out in a report.

Thanks [pc3]
 
Ya know Golom, if you didn't have this SQL sh*t down pat, you might be just a little too flippant!!! [roll2]


Leslie
 
Yeah, you're probably right. My apologies.

Next time I see a post with no question, no details and no indication of what, if anything, has been done to address the issue, I'll just ignore it.
 
Don't change on my account, I LIKE flippant!!! Especially when it's deserved!



Leslie
 
If I knew how to resolve this issue, I probably would not have joined this forum and posted this question. Since this was my first time at the website, I didn't think I would have to explain the entire problem from its conception. All I wanted to know was how to make selections from a listbox, have just the selections save to a field and print out in a report. I think that is what I said the first time. Thanks for a good first impression. [mad]

Thanks
[pc3] LeafyJellyFish
 
No we would like you to explain your problem from conception. It gives us a clearer picture of what you are trying to do and the best way to do it. Is the list box on a form? What is the form doing? Is there a button you press to print the report? Why would you need to save them?

We apologize for giving you a bad first impression. This really is a great forum.

Leslie
 
The db keeps track of what ads I put in certain newspapers. I have a list of companies that have several papers. When I select the company in the form, the listbox gives me a list of papers that that company owns. I would like to select specific papers out of that list when I am placing new ads, and have it save those selections. I made the field in the table a listbox also, but it didn't help. I also would like just those selections to show up in the report, and be saved in the table.

Thanks
[pc3] LeafyJellyFish
 
I would like the list box to also keep my selections highlighted, so when I scroll between records I can see what papers the ads were place in. It doesn't do that right now. I don't think this listbox is going to work for what I want.

Thanks
[pc3] LeafyJellyFish
 
Ok, so you want to store the papers selected from the list box in the table. So my next question is what is your table structure? Is your database normalized? If so then you should have a table structure like this:

tblCompany
CompanyID - PK
CompanyName
CompanyAddress
etc.

tblPapers
PaperID - PK
CompanyID - FK
PaperName

tblAds
AdId - PK
PaperID - FK

So you should have your combo box set up to get your Company Name from the tblCompany. Once you select a company, in the After Update event, you probably run a query that gathers all the papers that belong to that company and display them in the ListBox. In the After Update event of the ListBox, you will need to run an insert/update query to enter the PaperID into the tblAd.

To get the information in a report, you will need to set the Report Source to the query that gets the information that you need. When the report opens, it will run the query, get the data and put it on the report where you have specified.

If your table structure is not normalized or I have made some incorrect assumptions, please provide even more detail and I'll see what I can do.

Leslie

ps - if your tables are not normalized you may want to read this article:

 
LeafyJellyFish

I am sorry you got such a rocky start on this. From a "support" perspective, your original question was a tad vague and could involve a few hours to over a hundred hours of "volunteer" time.

Please understand that getting a form command to generate a report requeires the database to have sound design, and everything in place to do the task you are trying to do. However, the way the question was pharsed suggested that you need help to design a database, design a form and design a report. (BTW, there are forums for each of these topics.)

Moving on...

Leslie has given you a head start on design, and a valuable reference.

My question is -- are you designing a new database, or making changes to an existing database?

The reason I ask is that if you are still in the design mode, then this issues has to be addressed first.

If you you are making changes to an existing database, then "we" need to know what your current data looks like to help you with the List Box activity.

What you are trying to do, can be done. It is just a matter of where we start.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top