Solved

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

Posted on 2008-10-29
3
550 Views
Last Modified: 2013-11-27
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]));
0
Comment
Question by:Karl001
  • 2
3 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 22832008
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.
0
 

Author Comment

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

thanks

Carol
0
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 22832945
Sorry my typo.

Textbox.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now