Combo box quesion

B

Bob Parr

Two questions.

Question 1:
If I use the following two SQL statements for the Row source

SELECT [CompTypes].[ID], [CompTypes].[CompMod] FROM CompTypes;

and

SELECT [CompTypes].[ID], [CompTypes].[BareCode] FROM CompTypes;

for two different combo boxes. Can I expect that the order in each combobox
will be the same? I want to be able to make on combo box display the
corresponding data from the other combo box and wonder if I can just use the
row number of the combo box for exapmle:

Private Sub CompModel_Change() 'CompModel is on of the combo boxes

BarCode = CompModel

End Sub


Basically setting the row on BarCode to be the same as what was just
selected on CompModel. This will only work, if the two combo boxes are
filled in the same order.

Question 2:
My two combo boxes have as the 1st column an index number. Can I set a
combo box to display a row based on that index number, or do I have to
search for the index number to get the row it is in?
 
V

Van T. Dinh

Use [ID] as the bound Column for obth ComboBoxes. Use the AfterUpdate Event
of each ComboBox to change the value of the other ComboBox.
 

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