Bump: A97 ComboBox Rowsource (Continued)

  • Thread starter Thread starter Kahuna
  • Start date Start date
K

Kahuna

(Sorry to Bump - hoping for some suggestions)

Hi Folks as a follow up from the help I got yesterday regarding the proper
opening of the ComboBox:

Ahh - thanks for help guys but it seems there is another part to my
challenge.

I have the combo loading successfully now (thanks Marshall), but I am
loading
other text box's based on the other columns in the rowsorce for the combo -
so eg:

=[cboMatTypeDesc].[Column](5) loads the text field with data from column 5
of the combo (or 6 in fact as its 0 based) rowsource (or should).

However this is working sporadically. I have 35 or so fields being populated
in this way and many of them are simply not being read / populated from the
look-up table.

Is there a limit on how many columns there can be in the rowsource for the
combo (I am only displaying 10 - though not consecutively listed).

Is there a more elegant way to do this - I suspect DLookup would be clumsy
and time consuming during run, and there is the challenge of what to do when
there is no entry on the ComboBox - Dlookup inserts an Error?

Currently trying a workaround whith Dlookup and a default to a known record
in the link field - to avoid the 'Error' result.

Any suggestions ?
 
Kahuna,

Just my opinion, and I have not read the rest of your previous thread, but
If you are trying to load 30+ text boxes with the value from columns of a
combo box, you are doing something wrong.

My guess is that you need to set the RecordSource property of your form, and
bind all of these text boxes to fields in the forms recordSource. Then, when
you select an item from your combo box, you filter the form so that only the
selected record is visible.

When I do this, I usually put the combo box in the forms header, and have
some code in the combo boxes AfterUpdate event that sets the forms Filter and
FilterOn properties:

Private sub cbo_Filter_AfterUpdate

me.Filter = "[ID_Field] = " & me.cbo_Filter
me.FilterOn = True

End sub

HTH
Dale
 
Dale Fye said:
Kahuna,

Just my opinion, and I have not read the rest of your previous thread, but
If you are trying to load 30+ text boxes with the value from columns of a
combo box, you are doing something wrong.

My guess is that you need to set the RecordSource property of your form,
and
bind all of these text boxes to fields in the forms recordSource. Then,
when
you select an item from your combo box, you filter the form so that only
the
selected record is visible.

When I do this, I usually put the combo box in the forms header, and have
some code in the combo boxes AfterUpdate event that sets the forms Filter
and
FilterOn properties:

Private sub cbo_Filter_AfterUpdate

me.Filter = "[ID_Field] = " & me.cbo_Filter
me.FilterOn = True

End sub

HTH
Dale

Thanks Dale - thats interesteing using the filter like that.

--
Kahuna
------------
Kahuna said:
(Sorry to Bump - hoping for some suggestions)

Hi Folks as a follow up from the help I got yesterday regarding the
proper
opening of the ComboBox:

Ahh - thanks for help guys but it seems there is another part to my
challenge.

I have the combo loading successfully now (thanks Marshall), but I am
loading
other text box's based on the other columns in the rowsorce for the
combo -
so eg:

=[cboMatTypeDesc].[Column](5) loads the text field with data from column
5
of the combo (or 6 in fact as its 0 based) rowsource (or should).

However this is working sporadically. I have 35 or so fields being
populated
in this way and many of them are simply not being read / populated from
the
look-up table.

Is there a limit on how many columns there can be in the rowsource for
the
combo (I am only displaying 10 - though not consecutively listed).

Is there a more elegant way to do this - I suspect DLookup would be
clumsy
and time consuming during run, and there is the challenge of what to do
when
there is no entry on the ComboBox - Dlookup inserts an Error?

Currently trying a workaround whith Dlookup and a default to a known
record
in the link field - to avoid the 'Error' result.

Any suggestions ?
 
Back
Top