Continuous Forms - Combo box.RowSource

S

Stapes

Hi
I have a subform with the records displayed in the Continuous Forms
view. On each line, I have a group & a subgroup. Both fields are Combo
boxes. What I am trying to do is limit the choice of subgroups to
those pertaining to the group shown.
I have tried putting code in the On Current event in the form to allow
only the correct subgroups in the Combo box, but it seems to take the
criteria for the top record & apply it to all the others.

This is the code:-

Dim strSQL As String
strSQL = "SELECT TLK_SubGroups.PK_SubGroup,
TLK_SubGroups.TXT_SubAbriv, TLK_SubGroups.TXT_SubDet,
TLK_SubGroups.FK_MainGroup " & _
"FROM TLK_SubGroups " & _
"WHERE (((TLK_SubGroups.FK_MainGroup)=" & PK_Group & "));"

PK_SubGroup.RowSource = strSQL
PK_SubGroup.Requery

Any ideas how I can make it work?

Stapes
 
G

Guest

Stapes,

You could try putting that code in the OnEnter event of the combo box, so it
would should run it before the list drops down.
(have not tested).

HTH

Rico
 

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