MS Access Forum / Reports / Printing / March 2008
COmbo Box of Reports
|
|
Thread rating:  |
Combo Box Report list - 27 Mar 2008 17:26 GMT I'd like to know, how can I use the combo box to list ALL reports in my database and, when I choose a particular report, it is automatically updated based on new information in the tables?
Allen Browne - 27 Mar 2008 17:36 GMT See: List Box of Available Reports at: http://allenbrowne.com/ser-19.html
 Signature Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org.
> I'd like to know, how can I use the combo box to list ALL reports in my > database and, when I choose a particular report, it is automatically > updated > based on new information in the tables? lmossolle - 27 Mar 2008 17:40 GMT Please give more details, reportnames, etc...
> I'd like to know, how can I use the combo box to list ALL reports in my > database and, when I choose a particular report, it is automatically updated > based on new information in the tables? Combo Box Report list - 27 Mar 2008 18:38 GMT The report names are A,B,C. I'd like to create a list box with those names and when I choose report A, B or C, it it automatically updated and displayed.
> Please give more details, reportnames, etc... > > > I'd like to know, how can I use the combo box to list ALL reports in my > > database and, when I choose a particular report, it is automatically updated > > based on new information in the tables? Duane Hookom - 28 Mar 2008 00:23 GMT I always create a table of reports with the report object name, a friendlier report title, and possibly other information. Use this table as the Row Source of your combo box.
 Signature Duane Hookom Microsoft Access MVP
> The report names are A,B,C. I'd like to create a list box with those names > and when I choose report A, B or C, it it automatically updated and [quoted text clipped - 5 lines] > > > database and, when I choose a particular report, it is automatically updated > > > based on new information in the tables? Combo Box Report list - 28 Mar 2008 15:53 GMT I think I understand what youre talking about, however, how do you link a table with only the name of the reports to the reports themselves, and how do you get them to automatically update when you select a specific table from the combo box?
> I always create a table of reports with the report object name, a friendlier > report title, and possibly other information. Use this table as the Row [quoted text clipped - 9 lines] > > > > database and, when I choose a particular report, it is automatically updated > > > > based on new information in the tables? Duane Hookom - 28 Mar 2008 16:26 GMT Assuming you have a table ztblReports with fields rptName, rptTitle, rptStatus, rptDescription. The rptName field contains the actual name of the report ie: rptProjectStatus. Your combo box would have a Row Source property like:
SELECT rptName, rptTitle, rptDescription FROM ztblReports WHERE rptStatus <> 0 ORDER BY rptTitle;
Some other properties would be: Name: cboReport Column Widths: 0, 2, 0 Bound Column: 1 Column Count: 3
Your code to open a report would be something like:
Dim strRptName as String If Not IsNull(Me.cboReport) Then strRptName = Me.cboReport DoCmd.OpenReport strRptName, acPreview Else Msgbox "Choose a report", vbOkOnly, "PEBKAC" End If
 Signature Duane Hookom Microsoft Access MVP
> I think I understand what youre talking about, however, how do you link a > table with only the name of the reports to the reports themselves, and how [quoted text clipped - 14 lines] > > > > > database and, when I choose a particular report, it is automatically updated > > > > > based on new information in the tables? Combo Box Report list - 28 Mar 2008 16:41 GMT Duane, Thank you for your input, however, this is a little over my head. Can you recommend a book for a beginner (no programming experience) that I can refer to so that I can learn what this code means and how to wirte it?
> Assuming you have a table ztblReports with fields rptName, rptTitle, > rptStatus, rptDescription. The rptName field contains the actual name of the [quoted text clipped - 40 lines] > > > > > > database and, when I choose a particular report, it is automatically updated > > > > > > based on new information in the tables? Duane Hookom - 28 Mar 2008 17:09 GMT I would use the command button wizard to create a button that opens any report. Then change the code generated by the wizard to use the combo box value rather than the report name you specified with the wizard.
If you can't figure this out, reply back with your exact combo box name and the code generated by the command button wizard.
Regarding books, check John Viescas' page http://www.viescas.com/Info/books.htm#Visual%20Basic.
 Signature Duane Hookom Microsoft Access MVP
> Duane, > Thank you for your input, however, this is a little over my head. Can you [quoted text clipped - 45 lines] > > > > > > > database and, when I choose a particular report, it is automatically updated > > > > > > > based on new information in the tables? Combo Box Report list - 28 Mar 2008 17:51 GMT I'm really trying to follow and understand what you're telling me, but it's nor working our for me. I'm assuming that you mean VBA code when trying to use the command button, if so, then all I have is this:
Private Sub UPDATE_REPORT_Click()
End Sub
The name of the combo box is "Report LIst."
> I would use the command button wizard to create a button that opens any > report. Then change the code generated by the wizard to use the combo box [quoted text clipped - 55 lines] > > > > > > > > database and, when I choose a particular report, it is automatically updated > > > > > > > > based on new information in the tables? Combo Box Report list - 28 Mar 2008 17:56 GMT One more thing, I have a combo box which updates my reports based on the information in the tables. However, I have only figured out how to use this combo box for one report, but I have several reports that I want updated when I choose them. When using the combo box wizard it doesn't seem to allow you to choose all reports that you want. How do I amend this box to work like I want it?
> I would use the command button wizard to create a button that opens any > report. Then change the code generated by the wizard to use the combo box [quoted text clipped - 55 lines] > > > > > > > > database and, when I choose a particular report, it is automatically updated > > > > > > > > based on new information in the tables? Duane Hookom - 28 Mar 2008 21:13 GMT When I stated "button that opens any report" it was the same as when you get prompted to "press any key". It doesn't make any difference which key you press or which report you choose. There is no "any" report like there is no "any" key.
I have no clue how a combo box "updates my reports". You can use a combo box to select a report to open (like we are attempting) or possibly filter the record source of the report.
 Signature Duane Hookom Microsoft Access MVP
> One more thing, I have a combo box which updates my reports based on the > information in the tables. However, I have only figured out how to use this [quoted text clipped - 62 lines] > > > > > > > > > database and, when I choose a particular report, it is automatically updated > > > > > > > > > based on new information in the tables?
|
|
|