Combo box

steve111

Registered User.
Local time
Today, 08:29
Joined
Jan 30, 2014
Messages
429
hI ,

I am trying to set up a combo box that has 3 columns
the first column is the column I want to search on as I know the part number but it is the second column where I want the data to go into the combo box field

I cannot get the second column into the database

how do I set the combo box to do this

thanks
steve
 
hi,
please give specific details by stating the type of data you are retrieving,i.e like the tables and columns involved in the combo box, but to hint you, the following are the properties in the combo box that you have to alter.

1. column count value is 2

2. bound column value is 1


bound column is the field you want to search by.

the field to store in the database is column 2


e.g state field from states in a country is the bound column

the state field is from a states table,that also has a country field in the states table.


aim- you want the country data(column 2) after the user picks a specific state(column 1) from the combo box to be stored in the database in a field called country in the active form.


do the following

1. right click the state field in the active form(not the state table), then click on code,this will open the vba code window.

2. locate the after update event of the state field and type the following code into it

me.country=me.state.column(1)


thats all.

cheers
 
hi ,


thanks
I have put this into the after up date
me.productid=me.productno.column(1)

I did put this in the properties "after up date" is this correct ?

but after I enter data I get an error message saying

access cannot find the object "me"

steve
 
hI ,

I am trying to set up a combo box that has 3 columns
the first column is the column I want to search on as I know the part number but it is the second column where I want the data to go into the combo box field

I cannot get the second column into the database

how do I set the combo box to do this

thanks
steve

I guess you have a Bounded Combo that take it's data from another table.
In the Combo properties you can set which column will be bounded. The default is 1, but you can change it to any other column.

If you have the Part number in column1 and the Part name (Or details) in column2 I suggest you bound column1 and save the Part number (Not the name) into the table.
 
hi,


getting error message
compile error
method or data member not found



Private Sub ProductNo_AfterUpdate()
Me.ProductID = Me.ProductNo.Column(1)
End Sub

steve
 
thanks
I can set it like that but if possible I would like to try and search by column one and still show column 2 in the form and table if possible

steve
 
please state the following

1. the name of the columns involved at the form level.

2. the name of the column you want to search by

3. the column name you want to show.

4. the column name you want to store data into the db.

all the above are for the form level i.e column name at form level
 

Users who are viewing this thread

Back
Top Bottom