Combo Box - Confused on Record Source vs Control Source ?

Z

ZBC

I want to use a form to select a desired Unit# and to print a report.
The form contains a combo box to select the unit# for grouping on the
report and a command button to actually print the report (which uses a
query as it's record source for it's data).

My dilemma involve how to configure the combo box! ... I get confused
on record source and control source.

What I want is:
To use an existing two-field table (tblUnits containing field names:
Unit#, UnitName) as the means to select the Unit# for grouping of the
report.
I DO NOT want the user to be able to 'change' anything, either the Unit#
or UnitName in tblUnits.
I would like for the combo box to display BOTH the UnitName and the
Unit#; but 'at least' the UnitName.
I want the UnitName to appear on the report and the Unit# to be used for
record selection in my query. (I 'think' I have that part working OK).

I seem to be getting close, but I can't seem to get ALL of the above
working at the same time.
Bob
 
N

Nikos Yannacopoulos

1. Leave the Control Source property blank; this means it
is not bound to a field in a table somewhere (as in
storing changes).
2. Set the row source to a query which reads from tblUnits
with UnitName as the first field and Unit# as the second.
3. Set bound column to 2
4. Set column count (Format tab) to 2
Your form will display the UnitName in the combo box (and
both fiedls when combo is opened), and will return the
Unit#.

HTH,
Nikos
 
Z

ZBC

Nikos,
IT WORKS!
THANK YOU!
Bob

Nikos said:
1. Leave the Control Source property blank; this means it
is not bound to a field in a table somewhere (as in
storing changes).
2. Set the row source to a query which reads from tblUnits
with UnitName as the first field and Unit# as the second.
3. Set bound column to 2
4. Set column count (Format tab) to 2
Your form will display the UnitName in the combo box (and
both fiedls when combo is opened), and will return the
Unit#.

HTH,
Nikos


print a report.


grouping on the


(which uses a


get confused


field names:


grouping of the


either the Unit#


UnitName and the


to be used for


working OK).


of the above
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top