Display in combo box

E

Esrei

1. How do I get a combo box to display the value in the 3rd colum of the
fields I selected. The first column is stored in a nother field as a ID but
then I want the 3rd field to be displayed.
2. Where do I limit the combo box to fields from a querie to be displayed
when the drop down is clicked. Some thing like if a certan field in a record
= O it must not be displayed in the drop down

Thanks
 
D

Douglas J. Steele

1. In the ComboBox's AfterUpdate event, put code to refer to the value you
want using the Column property of the combobox. Note that columns start
numbering at 0, so if you want the value in the 3rd column of the currently
selected row, you need to use:

Me.MyComboBox.Column(2)

2. Create a query that eliminates the rows you don't want (through its WHERE
clause) and use the query as the RowSource for the combobox
 
E

Esrei

=Me.Combo9.[Column(1)] in after update returned:
The object dousn't containe the automation objectt me.
I am very new to this and don't understand a thing
 
D

Douglas J. Steele

Me is how you refer to the current form. I'm assuming your code is
associated with a Form, not in a stand-alone module.

Post the entire code for your AfterUpdate event (including its declaration)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Esrei said:
=Me.Combo9.[Column(1)] in after update returned:
The object dousn't containe the automation objectt me.
I am very new to this and don't understand a thing

Douglas J. Steele said:
1. In the ComboBox's AfterUpdate event, put code to refer to the value
you
want using the Column property of the combobox. Note that columns start
numbering at 0, so if you want the value in the 3rd column of the
currently
selected row, you need to use:

Me.MyComboBox.Column(2)

2. Create a query that eliminates the rows you don't want (through its
WHERE
clause) and use the query as the RowSource for the combobox
 
Top