Cindi wrote:
Hi,
Another newbie with a question that I hope someone can point me in the right
direction.
The goal is to populate a text box with data according to the selection in a
combo box while still being able to navigate the records one by one.
The combo box record source is a table/query asking for the ID, Subj, Title,
CourseGoals from one table and displays Column 1. I've set up the text box
source to display Column 4 of the combo box (CourseGoals). All seems to be
working well, however, the navigation does not work.
I do not have a record source set up for the form and when I did, it didn't
make any difference.
Any suggestions?
Thanks,
Cindi
You display 4 values but mention Column1. And you want to display
Column4. So I may not fully grasp your question but...
I created a combo box with a value list called Combo0. The values are
1 One
2 Two
3 Three
In the OnClick event I entered
Private Sub List0_Click()
MsgBox Me.Combo.Column(1)
End Sub
Now if I select 2, I get a messagebox "Two"
Let's say you have 4 columns. Column counts start at 0 to the number of
rows minus 1. It's weird, but that's the way it goes.
So in your case you'd want to access Column3.
You know, you could make the Combo the column the field's control
source. For example, if in your table you have a field called
CourseGoals, you could make the combo's control source CourseGoals.
Now, you would need to store the correct value into the field. To do
so, you would go to the Data tab of the Combo and select the column 4 to
store that value (the columns start at 1 instead of 0...it's weird, but
that's the way it goes) and in the Format tab set the column count to 4
and the column widths to whatever. I usually set the ListWidth to the
sum of the column widths.
One other thing, if you set ColumnHeading to Yes, the heading is Row0.
Anyway, you can find more into in Online help. Some other things to
look at in help are ListIndex, ItemData, ListCount and for Listboxes add
Selected and MultiSelect.