Unsing a ComboBox to filter the subform data

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

Guest

When I use the wizard to create the main form and subform everything works
fine but I can only switch the main form record using the navigation buttons.
I'd like to use a Combo to decide which record of the main table I'll use and
then see the filtered records of the secondary table in the subform datasheet.

It should be simple but I cannot find how to configure it in the help.

Thanks,

Marce
 
Marce,
I think your trying to figure out how to "jump" from one record to
another by selecting a value from a combo.
Here's some sample code I use...

I have a form where RollNo is a unique value, so I created a combo called
cboRollNo. The user selects a RollNo, and the code finds that record.
Using the AfterUpdate event of cboRollNo...

Private Sub cboFindRollNo_AfterUpdate()
Refresh
DoCmd.GoToControl "RollNo"
DoCmd.FindRecord cboFindRollNo
End Sub

hth
Al Camp
 
Thanks.

I meant to use the configuration to make the subform show the records
filtered by the value of the CB, the same way as the configuration of the
form allowed me to filter the subform records using the navigation tool. I
wanted to attach a small mdb to show what I mean but I don't see how to do it.

In any case I'll try the AfterUpdate event and see if I can make it work.

Thanks again,

Marce
 
Back
Top