Control subform range with two combo boxes

  • Thread starter Thread starter Paul R in Oregon
  • Start date Start date
P

Paul R in Oregon

Tables = tblIssue and tblManuscripts with one-to-many relationship

frmChooseIssuesDialog has cboFirstIssue and cboLastIssue combo boxes
based on one-field query on tblIssue

qry4subfrmDisplayChosenIssuesAndManuscripts queries tblIssue and
tblManuscripts and has following parameter under tblIssue.Issue field:

Between [Forms]![frmChooseIssuesDialog]![cboFirstIssue] And
[Forms]![frmChooseIssuesDialog]![cboLastIssue]

How do I get a sub form to display the manuscripts associated with the
issues in the range defined by the two combo boxes?
 
It sounds as if you've got all you need. I assume you've created a subform
in frmChooseIssuesDialog where you want the manuscripts to appear? Just set
the record source of this subform to
qry4subfrmDisplayChosenIssuesAndManuscripts and you're about there. I'd
suggest adding an after update event to the second combo box (you could do it
for both combos) that requeries the subform so that the user just has to
choose the issue number to see the new list, i.e.

Private Sub cboLastIssue_AfterUpdate()
Me.[name of subform].Requery
End Sub
 
Back
Top