Cascading combo box

  • Thread starter hunarch via AccessMonster.com
  • Start date
H

hunarch via AccessMonster.com

Cascading combo boxes and the considerable help in this Forum and its links
to examples on other web sites have overtaxed me.

I have a table with 3 fields: [Bvl], [Auth] and [Crit]

Using a query, the available field values have been limited to:
[Y] and [N] for [Bvl];
[A] and for [Auth]; and
[3] and [5] for [Crit].

[A] and each correspond with each of [Y] and [N].
[5] corresponds with [Y].[A] and [N].[A] AND [Y].
[3] corresponds only with [[N].

In other words, the choice of combinations are: [Y].[A].[5]; [Y].[B.[5]; [N].
[A].[5] and [N]..[3]

I want Combo2, incorporating the [Auth] and [Crit] fields to depend upon
Combo1 which incorporates the [Bvl] field. In other words, in Combo 2, I want
to select either A or B if Y is selected in Combo1, or A or B if N is
selected, and to have 3 or 5 displayed accordingly.

How should this be done?

Apologies for the non-technical description.
 
T

tina

so you are using a query as the RowSource for Combo2, correct? open the
query in Design view, and add criteria to the Bvl field, as

Forms!FormName!Combo1

replace FormName with the correct name of the form, of course. save and
close the query. in the form's Design view, add the following code to
Combo1's AfterUpdate event procedure, as

Me!Combo2.Requery

hth
 
H

hunarch via AccessMonster.com

Thank you tina.

Yes, I am using a Query as the RowSource for Combo2

This is what I now have:
----------------------
Combo 1
Control Source: Blank
Row Source Type: Table/Query
Row Source: SELECT DISTINCT tblRQTS.Bvl FROM tblRQTS;
Bound Column: 1
-------------------------
Combo2
Control Source: Blank
Row Source Type: Table/Query
Row Source: SELECT DISTINCT tblRQTS.Bvl, tblRQTS.Crit, tblRQTS.Auth FROM
tblRQTS WHERE (((tblRQTS.Bvl)=[Forms]![frmGratesRqts]![Combo1]));;
Bound Column: 1
-----------------------------

The combo boxes are working, but not properly: the result in Combo2 is not
being reflected as soon as Yes or No is selected in Combo1, although it is
being reflected in the Combo 2 Query. For example, if I select either Yes or
No in Combo 1, then open and close the Combo2 query, the Auth and Crit values
are correctly shown in Combo2, but only if I open then close the query.

What have I not yet done properly?
 
H

hunarch via AccessMonster.com

It now works (almost) properly after changing the Combo1 After Update Event
to
Me.Form.Combo2.Requery instead of Me.Combo2.Requery.

However, if I click on Combo2, the drop-down list shows the correct values
but I cannot select a value so that it remains in the Combo Box (it defaults
to the first value in the list).
If I change the Combo Box to List Box, the values remains displayed, but I
need a Combo Box.

What further adjustment is necessary?
 
H

hunarch via AccessMonster.com

All fixed.
I had the incorrect Bound Column Number for Combo2
 

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

Top