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

Pick Fields to be Displayed on Report 1

Status
Not open for further replies.

buee04

Technical User
Jun 27, 2002
129
US
Hi,

This is my first database and I'm now working on the reports section. I've been using Access for almost 2 months now and I don't have any experience with vb scripting.

I'd like to know if it's possible to pick certain fields (from different tables) to be displayed on the report. I have a results form, frmSearchResults, that displays the records searched. From that right now, when the user clicks on a certain record and click on the reports button, it opens up a report for that record.

But I'd like to add a form in between that process where the user can select whatever he/she wants to be displayed along with some default fields that are automatically on the report.

PLEASE. Any help is greatly appreciated!
 
well this is a little bit foggy, LOL
in the report that you want to select witch fields to display you can set some variables stored in a module to certain values (brrrr) ... in english ... put in a module variables like : Public Field_NAME_Visible As Boolean
when you exit this Form you set all the variables in the module.
On the next Form (the one with the details) on the OnOpen set you fields to be visible or not according to the variables in your module.

hope that helps a little bit
[pc3]
 
"the form with the details" can be a Report also
 
Hi!

Another possibility is to put a multiselect list box on the form that opens before the report and set the row source type to field list and set the row source to the query or table you base the report on. In the Open or Format event of the report you can go through the selections in the list box and assign different fields to text boxes on the report not forgetting to change the label. The rest of the text boxes that are not used can be set invisible. You can get fancier by allowing the user to select the fields in the order they want them to display by double clicking on them in the list box (which shouldn't be multiselect in this case) and then you can transfer them to a hidden text box on the form. At that point you could read both the fields the user wanted and the order they wanted them in. It's a lot of work but it will give the user a lot of flexibility.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Whew, I don't think I understand what you said RSi2. But I still appreciate you responding!

Jeff's way sounds easier, but still hard for me. Do you have any examples that you can give me cuz I think that would be the easiest way for me to learn at this point.

When I set the row source of a list box (is that the same as a multiselect list box?), it showed the records that were returned by the query. But how do I make it show the field names?

I don't know how to make the boxes that are selected visible and those that weren't invisible either.

 
write a mail to rsi2@yahoo.fr
i'll reply with a sample code
 
hey RSi2,

I didn't get your email, maybe it got lost when our mail server crashed? But can you send it again please?

jonathan.mau@york.com

THANKS!
 
Mmm, I still didn't get it. Perhaps my server filters out .mdb files. Here, can you send it to jonmau@hotmail.com ?

Thanks.
 
AWESOME jeff,

Thanks for the file. I got it now!

Would've never got it without you. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top