contr onol source from combo

luvbite38

Active Member
Joined
Jun 25, 2008
Messages
368
Hi Guys

Happy New Year to Y'all


I hope this would be the simplest Q for most of you.

I have a combobox containing the field names of a table called Main
Also, I have a report called xyz which only has one field.

All I was whatever field name user selects in the combo, report displays the results of selected field name only.

example

COmbo Vals

A
B
C
D

if user selects D
Report should only displays

results of field D

Hope it makes sense?

thanks a lot every1
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Smeone sent this to me and it helped. Maybe it will answer your question

"When searching using a combo, you generally use an unbound combo box (that's the option to remember for later use). If you use a bound control for searching you stand the risk of changing your data.
I place a combo in the form's header for this purpose, because unbound controls in a header / footer are visible from all records.
See if this tutorial helps you.

Denis "
 
Upvote 0
looks like the link in the message did not copy over. Search for my thread titled "VBA to use CombBox Stored Value to find a Record " and look for hyperlink
 
Upvote 0
hi buddy what I am looking for is bit different.

My Case
Table = Main
Form = Fm1
Combo (in Fm1) = Cm1
Button=Bt1
Report = Rp1
Textbox in detailed section of RP1 = Tx1

CM1 has the field names of Main Table.
I want user to select the field name from CM1
Hit a bt1 and rp1 should lists all the results of field name selected in CM1, no filters, no nothing. SImply want to control the field to display via combo box.

I tried following in the control source, but it is listing the field name instead the field values in the report. I have been looking for the solution fro mpast two days... :( pls pls pls pls help

[Forms]![Fm1]! [cm1]
 
Upvote 0
sound more like you want to run a query based on the results of a combo and then print the query results - not create a report

also to be clear, did you mean your comb showed a list of records? or the field names?
 
Upvote 0
Thanks buddy,

You're right, I am not creating a new report or a query,

and combo has Field Names

let me try to give an example

Example
Main Table has three fields (Fie1, Fie2 and Fie3)
The combo box lists the names of all three fields (Fie1 to Fie3)
Report has a textbox in the detailed section.
I want user to select the field name from combo click button to generate the report (lets day if user selected Fie2)
and want textbox to list all the records of Fie2

Hope it makes sense?

I just need a control souce expression which do this

i tried [Forms]![Fm1]! [cm1] but it is listing the field names not the values in the field...

pls help
 
Upvote 0

Forum statistics

Threads
1,214,534
Messages
6,120,080
Members
448,943
Latest member
sharmarick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top