Can I change column(1) in combo box?

D

Dennis

Hi,

I’m on Access via Office XP running XP Pro.

I have a combo box where I retrieve the property number, property address,
and property type using the following code:

Control name is cboPropNo and contains the property number.

strPropAddr = Me.cboPropNo.Column(1)
strPropType = Me.cboPropNo.Column(2)

I want to combine the address and type and put in back in column 1 so it
will display in the combo box.

I tried

Me.cboPropNo.Column(1) = strPropType & “ at “ & strPropAddr

When the above line executes, I receive the error message 424, Object
Required.


I have a couple of questions.

What do I need to do to correct this?
Can I change the Combo box to display another field other than column 1? If
so, how?

I resolved my immediate issue by concatenating the fields in my select query
for the combo box, but I would like to know the answers to the above
questions.

Thanks,
 
D

Douglas J. Steele

The Column collection is read-only.

Presumably the RowSource of the combo box is a query. You can add a computed
field to that query that concatenates the two other fields, and set the
ColumnWidths property of the combo box so that it displays the computed
field.
 
J

John W. Vinson

I want to combine the address and type and put in back in column 1 so it
will display in the combo box.

The data is not stored in the combo box. The combo box is *just a display
tool*, not a data repository.

You *could* run an Update query to update the Table upon which the combo box
is based, but you'ld do a lot better to instead base the combo box on a Query
which selects the desired data from the table, using calculated fields to
combine it as appropriate.
 
D

Dennis

Doug, John,

I did as you suggested and it worked fine. Thank you for your assitance.
 

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