Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display filtered results in subform

Status
Not open for further replies.

TaylorTot

Technical User
Dec 23, 2003
96
US
Hello,

I have a main for that enters an address when the cmdfilter button is clicked the following code is executed:
Code:
Private Sub FilterBrokers()
    Dim db As DAO.Database
    Dim rs20Mile As DAO.Recordset
    Dim MileCriteria As Long
    Dim qry As DAO.QueryDef, qry2 As DAO.QueryDef
    Set db = CurrentDb()
    
    Set qry2 = db.QueryDefs("ActiveAssets_SelQry")
      If "RUCA_SubClass" = "A" Then
        MileCriteria = 5
        Else
        If "RUCA_SubClass" = "B" Then
        MileCriteria = 25
     End If
    Set qry = db.QueryDefs("Get20Mile_SelQry")
    qry.Parameters("Miles_Param").Value = MileCriteria
    qry.Parameters(0) = Forms![frmMain]![txtZipCode]
    Set rs20Mile = qry.OpenRecordset(dbOpenDynaset)
        Set rs20Mile = qry.OpenRecordset()
     If Not rs20Mile.EOF Then
          
     rs20Mile.MoveLast
        rs20Mile.MoveFirst

    End If
    End If
End Sub
What I do not understand is how to display the above filtered data on my subform (fsubproperties)

Thanks for any help you can provide.
 
either Me!sfrmSomething.Form.Recordset = rs20Mile
or
Me!sfrmSomething.Form.Recordsource = "Get20Mile_SelQry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top