Multiple Fields to Open Subform

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

Guest

Is there any way to have two combo boxes and uswe the selections from both to
open a subform? I would want to select a number and a date and then show all
records that meet that criteria.

thanks
Sara
 
Is there any way to have two combo boxes and uswe the selections from both to
open a subform? I would want to select a number and a date and then show all
records that meet that criteria.

thanks
Sara

Do you want to *open* a new, pop-up form? Or are you talking about a
true Subform, which is permanently open in a subform control on the
mainform?

If the latter, you can use the names of the two combo boxes, separated
by a semicolon, as the Master Link Field property of the subform
control; and the two fields to be searched (again separated by
semicolons) as the Child Link Field.

If you're opening a new form instead, you can set the WhereCondition
property to a text string containing the values of the two combos:

Dim strWhere As String
strWhere = "[FieldA] = " & Me!cboComboA _
& " AND [FieldB] = " & Me!cboComboB
DoCmd.OpenForm YourForm, WhereCondition := strWhere


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top