Upon Change blank entries of dpdnt cascading combo boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 3 combo boxes, cboVirus (indpt), cboTest (dpdnt on Virus) and cboItem
(dpdnt on Test). I would like to know what code to write so that when the
user makes a mistake in virus choice, realizes it, and decides to change to a
different virus the subsequent combo box entries are undone. Similarly the
same should happen if an error in test was chosen (I would like the entry in
cboItem to be deleted).

I am assuming this would be easier than writing code to check entries
against eachother.

Each virus has its uniqe tests and each test has its own unique items.

Thanks,
AG
 
Hi Allen,

I must not have explained myself well enough (that's what you get for
posting questions at 1am). The cascading combo boxes work fine, in that only
the appropriate tests and then the appropriate items are available to choose
from depending on the choice made in previous combo box(es). The problem is
if the user goes back and changes their mind in one of the earlier combo
boxes and neglects to make the changes in the latter combo boxes. The
rowsources of the latter combo boxes will change but the previous entry the
user made is not erased resulting in a possible data entry error.

Some background: similar tests use similar items/reagents and cab be
designed for different viruses. The item combo box has a column count of 2;
the generic name of reagent and the specific item name, the former column is
the one that is bound and which shows up on the form. The reason for this is
because what the reagent actually is may change and its specific name is very
long and technical but its generic name will be the same (i.e. I may use a
car but which car may change). The specific name/composition of the reagent
is autofilled to another bound object. This same set up is used for cboTest.

As a consequence, if the user should change their mind and change the test
to a different but similar test ( that would use the same generic
items/reagents) the user doesn't know explicitly to change the item chosen
b/c it may have the same generic name. So I would like it set up such that a
change in a previous combo box "deletes" the entries of the latter combo
boxes forcing the user to choose again.

I hope that explains it. If not see the example below.

Virus A
â–¼
Sero Test
Bound column is generic name(Sero Test)
Unbound column is specific name and is used to autofill a bound text
object
â–¼
Reagent X
Bound column is generic name (X)
Unbound column is specific name/composition and is used to autofill a
bound text object

User realizes they are inputting data for reagent X of a sero test but for
Virus B not virus A, so they change the virus choice to Virus B. The problem
is that since the user only sees the generic test name (which is the same)
and the generic item name (which is also the same) they don't know that they
must change their choices in the latter two combo boxes so that the correct
specific test names and item names are stored in the database.

Thanks Allen,
AG
 
Just set **all** the "lower" combo box's value to Null when
you set the next "lower" combo box's row source. e.g.

Virus combo box's AfterUpdate event
Me.testcombo = Null
Me.reagentcombo = Null
Me.testcombo.RowSource = . . .

Test combo box's AfterUpdate event
Me.reagentcombo = Null
Me.reagentcombo.RowSource = . . .
 

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