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

Display value from combobox column as heading on report

Status
Not open for further replies.

g3a3n3n3

Technical User
Aug 6, 2003
43
0
0
AU
Hello,

I have a report which gets its data from a query. Also I have set up a form to get specific records froom this query.

The form has a combo box on it with three columns
Col 1 Organisation Name
Col 2 Organisation Code
Col 3 Organisation ID

It is set to display only the first two columns but sets the value of the combo box to the third column (ID).

The data looks similar to this

Organisation Name Organisation Code Organisation ID
Org A VSQ1 12
Org A VSF2 13
Org B VSR3 14
Org D VST6 15

and so on....

In my report I need the parameters to be printed. For this I put a textbox on Report header and set the control source to the combobox on the form but I realised that I dont get the output that I needed.

The report header now says

Organisation Name: 13

but I want it to say "Org A - VSF2"

HELP!!!!


Gillian
 
You need to refer to the specific COLUMN in the combo box's data.

The combo box columns are refered to by NUMBER starting with ZERO

So:-

cboOrgList.Column(0) will give you Org Name

cboOrgList.Column(1) will give you Org Code

cboOrgList.Column(2) will be the same as cboOrgList in your set up because you have column(2) as the bound column

So in the text box control's ControlSource you need :-
Code:
cboOrgList.Column(0) & " - " & cboOrgList.Column(1)


'ope-that-'elps.





G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Thanks G LS that works really well!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top