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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting from a Form for a Report

Status
Not open for further replies.

Pottsie

Technical User
May 19, 2004
11
AU
G'day all,

Does anyone know how to pass selected items in a form to a report?

For example: A Sales rep wants to select Product A, B and C to go into a report from a form. How do you go about passing the selected products to a report.

So far I can pass one product through, using a query to select one product, but in this case I'll need to be able to select X amount of items.

Thanks in advance

Cheers

Pottsie

- Laser / Escort / 323/ Familia (GTX and GTR) Owners Group
 
You may consider a multiselect listbox (in the form launching the report) and the load event procedure of the report can browse the select items.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

Sorry mate, but I'm not entirely sure what you mean there?

As far as using multiple select listboxes, I can't really use them in this case, as I need to be able to select from multiple products on one particular form from several groups, and basic information needs to be present for each product.

As for the load event bit, I've got next to no experience in VB programming, so is there a way to pass the selected products with a query or macro?

Thanks again

Pottsie

- Laser / Escort / 323/ Familia (GTX and GTR) Owners Group
 
There are several ways to do what you want. Here are some questions for you.

1) Will more than one person use the application at the same time?
2) If it is for a group, is there just one .mdb, or does everyone have their own front end?
3) How many records will the largest table hold? You don't have to worry about speed if you only have a few thousand records. If you have hundreds of thousands, then speed probably is a concern.
4) Are all of the choices from pre-determined lists, or can the user input criteria? For example, is it more like "Choose Paris, New York, or Moscow" or "Input a city"?
5) If the user chooses from pre-determined lists, can he choose more than one item?

 
G'day OhioSteve,

Thanks for the reply, and in response to your questions:

1) No, as it'll be run from a couple of laptops using local copies to create business quotes.

2) Nah mate, just the one database file per computer

3) It wouldn't be any more than a couple of hundred records if even that

4) Probably closer to "Choose Paris, New York and Moscow" from A form using Tickboxes (If possible)

5) The user needs to be able to select any number of items from a form using tickboxes to indicate that they'd like to select products X, Y and Z

Thanks again

Pottsie

- Laser / Escort / 323/ Familia (GTX and GTR) Owners Group
 
Hi

Given that you are dealing with a single user db, the easiest way to do this is basically:

Use a sub form to list the available options, each line of the list to have a checkbox to allow the user to select/deselect

Have a query in the report which includes the table which the user has updated with the ticks, and have a criteria on the relavant column of true

That is the basic idea, it is difficult to give more precise guidance without knowing which bits you do not know how to to

Hope that helps

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
This is what a textbook would tell you to do:

1) Create a table with all of the required fields. The checkbox values should have the "yes/no" data type.
2) Create a select query called query1. It will include all of the table's fields.
3) Create another select query called query2. It will have form1 controls as its data sources.
4) Create a report with query2 as its data source.
5) Create a form bound to query1 called form1. Include controls to populate all of the fields. Include a button labeled "print this record". The print button will print the report.

I don't know your level of experience. If you want me to explain one of the steps in greater detail, just ask.

I don't know about any special requirements you may have. If there is something unusual about this project, let me know.

PS: Are you really in Australia?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top