Combo box display

  • Thread starter Thread starter danc09
  • Start date Start date
D

danc09

Using A2K, I have 2 combo boxes on a continuous form, cboCompany and
cboDescription. After I make a selection in cboCompany, I would like to have
only descriptions from cboCompany display for selection in cboDescription.
In a query, I looked for descriptions from the form and cboCompany. This
works for the first occurrence of the continuous form, but the same
descriptions are displayed for each additional line even if a new company has
been selected on cboCompany.
How can I get this to work?
Thank,
Dan
 
Hi danc09

After each selection of cboCompany you need to requery cboDecsription


In the properties box of cboDescription open the select query and enter the
criteria :-

Forms!FormName.cboCompany

In the properties box of cboCompany
select "After Update" then select "Event Proceedure"

For the "Event Proceedure code enter the following command

Me.cboDescription.requery

Have fun

DeltaTech
 
In the "after update" event of cboCompany change the "row source" of
cboDescription to match the value in cboCompany.

should look like :
me.cboDescription.rowSource = "Select [YourTableName].Description FROM
[YourTableName] WHERE [YourTableName].CompanyName = '" & me.cboCompany.Value
& "'"

Should do the tirck!
 

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

Back
Top