If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Choose Report through command button
Hi!
I have one form with 4 sequential combos: CboType, Cbo2, Cbo3 and Cbo4. In the end of the research, one listbox shows us the result. In adition, I have 5 Reports, one for each Type, chosen in the CboType. Each Type has different fields, therefore, different Reports. It would like: With one command button in form, in the end of the research, to open the corresponding Report to the Type chosen in the Cbo1. Thanks in advance. an |
#2
|
|||
|
|||
Choose Report through command button
One solution: In your RowSource for cboType, have a column with the name of
the report desired. You don't need to display it and can set it's column width to zero. If it is the 3rd column in your RowSource your code on the click event of the Cmd button could be: DoCmd.OpenReport cboType.Column(2) The column index is zero-based which means that column(2) is the third column. HTH -- sam "an" wrote: Hi! I have one form with 4 sequential combos: CboType, Cbo2, Cbo3 and Cbo4. In the end of the research, one listbox shows us the result. In adition, I have 5 Reports, one for each Type, chosen in the CboType. Each Type has different fields, therefore, different Reports. It would like: With one command button in form, in the end of the research, to open the corresponding Report to the Type chosen in the Cbo1. Thanks in advance. an |
#3
|
|||
|
|||
Choose Report through command button
smK23,
Thanks for your reply. I am a little confused because in the RowSouce of query I have: SELECT DISTINCT Q_MultiField.Type FROM Q_MultiField ORDER BY Q_MultiField.Type; an "smk23" wrote: One solution: In your RowSource for cboType, have a column with the name of the report desired. You don't need to display it and can set it's column width to zero. If it is the 3rd column in your RowSource your code on the click event of the Cmd button could be: DoCmd.OpenReport cboType.Column(2) The column index is zero-based which means that column(2) is the third column. HTH -- sam "an" wrote: Hi! I have one form with 4 sequential combos: CboType, Cbo2, Cbo3 and Cbo4. In the end of the research, one listbox shows us the result. In adition, I have 5 Reports, one for each Type, chosen in the CboType. Each Type has different fields, therefore, different Reports. It would like: With one command button in form, in the end of the research, to open the corresponding Report to the Type chosen in the Cbo1. Thanks in advance. an |
#4
|
|||
|
|||
Choose Report through command button
Can you add a column to the table Q_MultiField and put the name of the
report to call there? Then change the RowSource to "SELECT DISTINCT Q_Mutifield.Type, Q_Multifield.ReportName FROM ..." Change the number of columns to 2 set the column width of the second item to zero. Since you only have two columns, you would use DoCmd.OpenReport cboType.Column(1) -- sam "an" wrote: smK23, Thanks for your reply. I am a little confused because in the RowSouce of query I have: SELECT DISTINCT Q_MultiField.Type FROM Q_MultiField ORDER BY Q_MultiField.Type; an "smk23" wrote: One solution: In your RowSource for cboType, have a column with the name of the report desired. You don't need to display it and can set it's column width to zero. If it is the 3rd column in your RowSource your code on the click event of the Cmd button could be: DoCmd.OpenReport cboType.Column(2) The column index is zero-based which means that column(2) is the third column. HTH -- sam "an" wrote: Hi! I have one form with 4 sequential combos: CboType, Cbo2, Cbo3 and Cbo4. In the end of the research, one listbox shows us the result. In adition, I have 5 Reports, one for each Type, chosen in the CboType. Each Type has different fields, therefore, different Reports. It would like: With one command button in form, in the end of the research, to open the corresponding Report to the Type chosen in the Cbo1. Thanks in advance. an |
#5
|
|||
|
|||
Choose Report through command button
But I have 4 different reports, because they are differents fields, consonant the type... an "smk23" wrote: Can you add a column to the table Q_MultiField and put the name of the report to call there? Then change the RowSource to "SELECT DISTINCT Q_Mutifield.Type, Q_Multifield.ReportName FROM ..." Change the number of columns to 2 set the column width of the second item to zero. Since you only have two columns, you would use DoCmd.OpenReport cboType.Column(1) -- sam "an" wrote: smK23, Thanks for your reply. I am a little confused because in the RowSouce of query I have: SELECT DISTINCT Q_MultiField.Type FROM Q_MultiField ORDER BY Q_MultiField.Type; an "smk23" wrote: One solution: In your RowSource for cboType, have a column with the name of the report desired. You don't need to display it and can set it's column width to zero. If it is the 3rd column in your RowSource your code on the click event of the Cmd button could be: DoCmd.OpenReport cboType.Column(2) The column index is zero-based which means that column(2) is the third column. HTH -- sam "an" wrote: Hi! I have one form with 4 sequential combos: CboType, Cbo2, Cbo3 and Cbo4. In the end of the research, one listbox shows us the result. In adition, I have 5 Reports, one for each Type, chosen in the CboType. Each Type has different fields, therefore, different Reports. It would like: With one command button in form, in the end of the research, to open the corresponding Report to the Type chosen in the Cbo1. Thanks in advance. an |
#6
|
|||
|
|||
Choose Report through command button
I understood from your original post that each selection in cbotype had a
different report: In adition, I have 5 Reports, one for each Type, chosen in the CboType. Do you have 5 items in your list for cboType, and are each of those items associated with a different report? If that is not the case, you will need a different solution. In the code for your command button: You can use a "SELECT Case" statement and specify the parameters required to select the desired report. -- sam "an" wrote: But I have 4 different reports, because they are differents fields, consonant the type... an "smk23" wrote: Can you add a column to the table Q_MultiField and put the name of the report to call there? Then change the RowSource to "SELECT DISTINCT Q_Mutifield.Type, Q_Multifield.ReportName FROM ..." Change the number of columns to 2 set the column width of the second item to zero. Since you only have two columns, you would use DoCmd.OpenReport cboType.Column(1) -- sam "an" wrote: smK23, Thanks for your reply. I am a little confused because in the RowSouce of query I have: SELECT DISTINCT Q_MultiField.Type FROM Q_MultiField ORDER BY Q_MultiField.Type; an "smk23" wrote: One solution: In your RowSource for cboType, have a column with the name of the report desired. You don't need to display it and can set it's column width to zero. If it is the 3rd column in your RowSource your code on the click event of the Cmd button could be: DoCmd.OpenReport cboType.Column(2) The column index is zero-based which means that column(2) is the third column. HTH -- sam "an" wrote: Hi! I have one form with 4 sequential combos: CboType, Cbo2, Cbo3 and Cbo4. In the end of the research, one listbox shows us the result. In adition, I have 5 Reports, one for each Type, chosen in the CboType. Each Type has different fields, therefore, different Reports. It would like: With one command button in form, in the end of the research, to open the corresponding Report to the Type chosen in the Cbo1. Thanks in advance. an |
#7
|
|||
|
|||
Choose Report through command button
Is correct.
I have one form for each Type. My dificult is write the code on cmd to choose exactlty If IdType1 ("hidden" in cboType) then R_Type1, IfIdType2 then R_Type2,... In adition: My CboType has Type and IdType fields with column count=2, column widths=1cm;0cm and bound column=1 Thanks an "smk23" wrote: I understood from your original post that each selection in cbotype had a different report: In adition, I have 5 Reports, one for each Type, chosen in the CboType. Do you have 5 items in your list for cboType, and are each of those items associated with a different report? If that is not the case, you will need a different solution. In the code for your command button: You can use a "SELECT Case" statement and specify the parameters required to select the desired report. -- sam "an" wrote: But I have 4 different reports, because they are differents fields, consonant the type... an "smk23" wrote: Can you add a column to the table Q_MultiField and put the name of the report to call there? Then change the RowSource to "SELECT DISTINCT Q_Mutifield.Type, Q_Multifield.ReportName FROM ..." Change the number of columns to 2 set the column width of the second item to zero. Since you only have two columns, you would use DoCmd.OpenReport cboType.Column(1) -- sam "an" wrote: smK23, Thanks for your reply. I am a little confused because in the RowSouce of query I have: SELECT DISTINCT Q_MultiField.Type FROM Q_MultiField ORDER BY Q_MultiField.Type; an "smk23" wrote: One solution: In your RowSource for cboType, have a column with the name of the report desired. You don't need to display it and can set it's column width to zero. If it is the 3rd column in your RowSource your code on the click event of the Cmd button could be: DoCmd.OpenReport cboType.Column(2) The column index is zero-based which means that column(2) is the third column. HTH -- sam "an" wrote: Hi! I have one form with 4 sequential combos: CboType, Cbo2, Cbo3 and Cbo4. In the end of the research, one listbox shows us the result. In adition, I have 5 Reports, one for each Type, chosen in the CboType. Each Type has different fields, therefore, different Reports. It would like: With one command button in form, in the end of the research, to open the corresponding Report to the Type chosen in the Cbo1. Thanks in advance. an |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
subreport not displaying in main report | JohnLute | Setting Up & Running Reports | 15 | November 17th, 2005 04:02 PM |
Reporting subreport total on main report | BobV | Setting Up & Running Reports | 22 | November 1st, 2005 03:19 AM |
Printing Reports Access 2002 Pleas Advise | Dermot | Database Design | 12 | October 5th, 2005 11:23 AM |
To Sharkbyte and all: Calculate a total values in group level | Ally | General Discussion | 6 | June 13th, 2005 08:16 PM |
Help!! I'm running around in circles! | CathyA | New Users | 19 | December 12th, 2004 07:50 PM |