A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Varible control source for field



 
 
Thread Tools Display Modes
  #1  
Old September 29th, 2005, 08:41 PM
Biggles
external usenet poster
 
Posts: n/a
Default 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  
Old October 2nd, 2005, 12:44 AM
Duane Hookom
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 03:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.