Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: How to create a report using code rather than the report designer tools.


Message #1 by daniel.eugen@m... on Thu, 16 Aug 2001 19:22:09
Scenario:



I have a form with 20 fields on it.  A user selects which of the fields 

are to be used in a query and specifies values for those chosen fields 

which are to be used to build up a string that will be used as the query.



When the user completes the fields and clicks the "generate report" 

button, I would like to have a report created based only on the entries 

chosen.



Being able to control the layout of the report would be great, but right 

now I have no idea how I can code the generating of a report based on a 

query that only exists momentarily during the execution of the application.



I've tried to figure out if I can use the Report Wizard, but it only 

brings up a blank report.



Any help would be most appreciated.



Thanks.
Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Thu, 16 Aug 2001 12:30:22 -0700
I don't know exactly what your needs are, but one thing to maybe try is use

a single report with all of the fields on it, based just on the underlying

table.  Then when your user clicks "generate report", you build up a filter

string to pass to the report, and programatically set unchosen field

controls .Visible property to False.



HTH,



-Roy



-----Original Message-----

From: daniel.eugen@m... [mailto:daniel.eugen@m...]

Sent: Thursday, August 16, 2001 12:21 PM

To: Access

Subject: [access] How to create a report using code rather than the

report designer tools.





Scenario:



I have a form with 20 fields on it.  A user selects which of the fields 

are to be used in a query and specifies values for those chosen fields 

which are to be used to build up a string that will be used as the query.



When the user completes the fields and clicks the "generate report" 

button, I would like to have a report created based only on the entries 

chosen.



Being able to control the layout of the report would be great, but right 

now I have no idea how I can code the generating of a report based on a 

query that only exists momentarily during the execution of the application.



I've tried to figure out if I can use the Report Wizard, but it only 

brings up a blank report.



Any help would be most appreciated.



Thanks.
Message #3 by daniel.eugen@m... on Fri, 31 Aug 2001 15:40:38
Apologies for not replying to your prompt feedback.



You actually did understand what I was trying to achieve, and I sort of 

thought of the same layout as you recemmended.  However, if I just make 

certain elements in the report invisible, it would make the report layout 

very unsightly with many gaps in between lines.



That's why I'm trying to either create that report based on the chose 

fields, or somehow limit the fields that are not just visible but actually 

even present on the report page.



I've never worked with Filters, or reports extensively for that matter, 

but I'll give this a try.



Thank you again.





> I don't know exactly what your needs are, but one thing to maybe try is 

use

> a single report with all of the fields on it, based just on the 

underlying

> table.  Then when your user clicks "generate report", you build up a 

filter

> string to pass to the report, and programatically set unchosen field

> controls .Visible property to False.

> 

> HTH,

> 

> -Roy

> 

> -----Original Message-----

> From: daniel.eugen@m... [mailto:daniel.eugen@m...]

> Sent: Thursday, August 16, 2001 12:21 PM

> To: Access

> Subject: [access] How to create a report using code rather than the

> report designer tools.

> 

> 

> Scenario:

> 

> I have a form with 20 fields on it.  A user selects which of the fields 

> are to be used in a query and specifies values for those chosen fields 

> which are to be used to build up a string that will be used as the query.

> 

> When the user completes the fields and clicks the "generate report" 

> button, I would like to have a report created based only on the entries 

> chosen.

> 

> Being able to control the layout of the report would be great, but right 

> now I have no idea how I can code the generating of a report based on a 

> query that only exists momentarily during the execution of the 

application.

> 

> I've tried to figure out if I can use the Report Wizard, but it only 

> brings up a blank report.

> 

> Any help would be most appreciated.

> 

> Thanks.

  Return to Index