If you'd like, you can configure your combo box to show both of these, or
store data for the Plan while showing only the Plan Reports... this is
generally a more practiced approach. If not you can set a textbox to the
Plan Report based on the Plan selected in the combo as well.
To do this with only a combo box, showing the Plan and Plan Report columns
from your table, here's some properties to set (location of the properties is
based on 2003 and previous versions, not sure how they're located in 07):
on the Data tab of the properties box:
Row Source Type: Table/Query
Row Source: the table that holds your two columns
Bound Column: 1
and on the Format tab:
Column Count: 2
Column Widths: 0.5"; 1"
This will show both columns, Plan and Plan Reports, while storing the value
of column one (presumably "Plans")... assuming this is a bound control it
will store the value, anyway.
If you want, you can hide the "Plan" column by setting the column widths to
0"; 1"
This will hide the Plans column, and only show reports, but will still save
the value as the Plan column assuming the control is bound to a field.
Or.... if you want to continue using a textbox, use the AfterUpdate event of
the Combobox to set the value of the text box:
Private Sub Combobox_AfterUpdate()
Me.Textbox = Nz(DLookup("[Plan Reports", "PlansTable", _
"[Plans] = " & Me.Combobox, "")
End Sub
This assumes that "Plan" is a number field... if it's a string you need to
enclose it in quotes....
"[Plans] = """ & Me.Combobox & """", "")
hth
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
Jecker said:
I have a table that contains 'Plans" and "Plan Reports". The "Plan Reports"
is the name of the report that coincides to the Plan. I have a combo box
that reflects all the "Plans". What I need to do is have the Text Box look
at what is chosen in the Combo Box and relfect the report that coincides with
the "Plan" in the text box. I eventually want my form to run the report that
coincides with the "Plan" that is reflected in the text box.
Any assistance would be most appreciated
Thanks,
Jecker