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

Subforms and Reports

Status
Not open for further replies.

EuanPirie

Programmer
Apr 15, 1999
66
GB
Hello everybody.<br>
<br>
I am developing a database that has will generate a set of reports. The reports can be run from any number of menus. I have placed the options of which report to run into a combo box, with a button to run the report. Anybody know how to link the names listed in the combo box to select the report?<br>
<br>
Secondly, on a similar theme, I have linked a combo box controlling the record that a report uses to generate itself in the past, but how do i link a combo box listing, for example, work request numbers, to a report option combo box that runs a report on, say, the analysis status of that work request, which will run when you press a button. (for information, button is marked &quot;Run a report&quot;. Surprising that...)<br>
<br>
Thank you all very much for any help.
 
I have a reporting form that runs as follows: (been using it for 6 years so it could probably be done better!).<br>
tblreports has 3 fields, ireportnumber, strreportname, strpropername. Sort by reportnumber to get the table in the right order. Propername shows the english version of the report name &quot;Management Report for Current Month&quot; and reportname is the physical name &quot;rptmngmtcurmonth&quot;.<br>
<br>
Now stick a button marked run report on the form.<br>
<br>
Function fnRunReport(passedname As String)<br>
<br>
Dim db As Database ' Set up local database name<br>
Dim localname As String ' Set up local report name<br>
<br>
Set db = CurrentDb() ' Set up local database<br>
<br>
localname = passedname ' Set local report name to passed name<br>
DoCmd.OpenReport localname, A_PREVIEW ' Open Report<br>
<br>
End Function<br>
<br>
In the report, all of the parameters use forms!frmreports!fieldname1 and so on to pick up data off the form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top