By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Problem with combo boxes

P: n/a
I am having a problem working with one combo box that is filtering
another combo box.

My table is tblResearch. There are two field in this table; one
is[StudyCategory] and the other [Study]. I have a form called
frmResearch on which there are two combo boxes. The control source
for the first combo box [cbxCategory] is the field StudyCategory. The
control source for the 2nd combo box, [cbxStudy] is the field Study
and it's row source is a query called qrySelect. qrySelect selects
all studies where the category = cbxCategory from a table called
luStudies. When cbxCategory is updated, cbxStudy is requeried.

All works well unless the user decides that they want to delete what
they have entered into these boxes and leave it as blank. When they do
this (by highlighting the option in cbxCategory and pressing delete)
the update event requeries cbxStudy and it becomes blank as well.
This gives the user the impression that they have now deleted anything
that is in the underlying table. This is true for the StudyCategory
field, but the Study field retains whatever data they had previously
chosen.

How can I get the table get rid of the data in the field Study if the
user chooses to do the above?
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
D Perron wrote:
I am having a problem working with one combo box that is filtering
another combo box.

My table is tblResearch. There are two field in this table; one
is[StudyCategory] and the other [Study]. I have a form called
frmResearch on which there are two combo boxes. The control source
for the first combo box [cbxCategory] is the field StudyCategory. The
control source for the 2nd combo box, [cbxStudy] is the field Study
and it's row source is a query called qrySelect. qrySelect selects
all studies where the category = cbxCategory from a table called
luStudies. When cbxCategory is updated, cbxStudy is requeried.

All works well unless the user decides that they want to delete what
they have entered into these boxes and leave it as blank. When they do
this (by highlighting the option in cbxCategory and pressing delete)
the update event requeries cbxStudy and it becomes blank as well.
This gives the user the impression that they have now deleted anything
that is in the underlying table. This is true for the StudyCategory
field, but the Study field retains whatever data they had previously
chosen.

How can I get the table get rid of the data in the field Study if the
user chooses to do the above?


In the AfterUpdate event of the primary combo you could enter something like
If IsNull(Me.PrimaryCombo) Then
Me.SecondaryCombo = Null
ENdif
Me.SecondaryCombo.Requery

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.