Link to home
Start Free TrialLog in
Avatar of Karl001
Karl001Flag for Canada

asked on

Combo box depend of an other one - update problem - Access

Hi,
I have a continuous form that shows multiple records.
On that form, for each record, I have 2 combo box (cmbDirection, cmbTitle) where one depends of the other, base on a query.
When I select a value on "cmbDirection",  the values in  "cmbTitle" combo box changes.

My problem is, when I change the "cmbDirection field" for one record, all "cmbTitle" values for all other records are change at the same time and take the values associate to the "cmbDirection» I just selected. That means, other records don't have anymore the right "cmbTitle" values.
How can I correct this?
Thanks,

Carol

cmbDirection combobox: (2 Columns, 1 description,  the other the Id)
Event:
  Private Sub cmbDirection_Change()
       Me.txtDirectionID = Me.txtDirection.Column(1)
      Me.cmbTitle.Requery
  end sub


cmbTitle combo box RowSource property :
  SELECT qry_Title.formationTitle FROM qry_Title;

Query qry_Title :
  SELECT tbl_Description.Title AS formationTitle,    
                  tbl_Description.IdDirection
  FROM tbl_Description
  WHERE  
(((tbl_Description.IdDirection)=[Forms]![frm_Formation]![txtDirectionId]));
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

This is a characteristic of continuous forms.
At any point there can only be one rowsource for a control - no matter how many copies of that control you can see.
Therefore when the value in one record is not contained in the rowsource, because the rowsource is now based on some other records data, no value shows in the form for that record.  This does not effect the value stored for each record.

To show the current record value for every record, you have to use a checkbox.  By careful placement of the checkbox and the combobox, laying one on the other, and use of transparency settings, you can create the illusion of a drop down list which displays the correct value for each record.
Avatar of Karl001

ASKER

I don't understand the simulation of a drop down list by using a checkbox.

thanks

Carol
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial