Multiple Fields to Open Subform

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
 
J

John Vinson

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
 

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