Continuous Forms - Combo box.RowSource

  • Thread starter Thread starter Stapes
  • Start date Start date
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
 
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
 
Back
Top