Managing a ComboBox DataSource in a Continuous Form

K

kc-mass

Hi

I have a continuous form which has a combobox on each line.

I want to change the datasource for the combobox depending on what type of
data is in the other fields of that line. I know how to do that.

My problem is that I do not know how to tell which line of the form has been
clicked on.
How can I tell which line in the form I am on so I can set the right data
source??

Thx

Kevin
 
D

Dirk Goldgar

kc-mass said:
Hi

I have a continuous form which has a combobox on each line.

I want to change the datasource for the combobox depending on what type of
data is in the other fields of that line. I know how to do that.

My problem is that I do not know how to tell which line of the form has
been clicked on.
How can I tell which line in the form I am on so I can set the right data
source??


I'm not sure I undertsand the question. When a user clicks on one of the
rows of a continuous form, the form's Current event will fire, and that
row's field values become those that are known by name to the form (as in
"Me.FieldName"). You don't need to do any indexing by line number. So the
Current event is a reasonable place to set the combo box's rowsource.

There can be an issue with combo boxes when you set the rowsource depending
on the current row, and the combo box's LimitToList property is True, and
the values displayed by the combo box in other rows are no longer in the
rowsource. Various workarounds for this issue exist. If that's your
problem, post back for further discussion.
 
K

kc-mass

Dog and Dirk

Thanks so much. Between the two reponses I'm off and running

Thx

Kevin
 

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