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
|
|||
|
|||
Varible control source for field
I have users select a grouping method for reports, and that works great
(based on code from Allen Browne's site). When they choose a particular field for grouping, I want a title box to display the name of the group - if they choose to group by deparment, i want the title box to display "Accounting" "Operations" "IS" etc. However, if I make the controlsource of the text box the value of the combo box, it tells me "Department". How can I make the control source of the text box dynamic to show the values in the table "Department" instead of the name of the table itself? Biggles |
#2
|
|||
|
|||
An alternative solution defines the sorting and grouping field in the query.
For instance if you have a form (frmPrintRpt) with an option group (optSortBy) that allows the user to select a sorting field: 1) in the query, create a calculated column like PriSort:Choose(Forms!frmPrintRpt!optSortBy, [Dept], [LastName], [EmpStatus]) These are three different fields in the record source that correspond with the option group values. 2) set your first level of sorting to the field [PriSort] This will take on the column values of the selected field. 3) if you want a column label for the field in the report, use: =Choose(Forms!frmPrintRpt!optSortBy, "Department", "Last Name", "Status") -- Microsoft Access MVP "Biggles" wrote: I have users select a grouping method for reports, and that works great (based on code from Allen Browne's site). When they choose a particular field for grouping, I want a title box to display the name of the group - if they choose to group by deparment, i want the title box to display "Accounting" "Operations" "IS" etc. However, if I make the controlsource of the text box the value of the combo box, it tells me "Department". How can I make the control source of the text box dynamic to show the values in the table "Department" instead of the name of the table itself? Biggles |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Toolbars, Drop-Down Menus | Rick | New Users | 1 | September 21st, 2005 11:17 AM |
Manipulating Control Source 2nd Time | coronacity | Using Forms | 4 | August 10th, 2005 10:25 PM |
Field views not showing up on Control source | ssciarrino | Using Forms | 3 | April 22nd, 2005 07:00 PM |
Access Calendar | lost | General Discussion | 2 | July 7th, 2004 04:58 AM |
How to assign value to a report control? | Peter | General Discussion | 3 | June 29th, 2004 11:17 AM |