rs filter

Results 1 to 2 of 2

Thread: rs filter

  1. #1
    rho Guest

    Default rs filter

    how do i set a filter to a rs on a specific field

  2. #2
    CHOR Guest

    Default RE: rs filter

    Use the Filter property of a recordset to limit it&#039s record and then open another new recordset on it. <BR><BR> For example, in the sub sFilterRS, I&#039m limiting rs2 to a single record by setting a filter on rs1.<BR><BR>&#039***************** Code Start *******************<BR>Sub sFilterRS()<BR>Dim db As Database, rs1 As Recordset<BR>Dim rs2 As Recordset<BR> Set db = CurrentDb<BR> Set rs1 = db.OpenRecordset("Select * from tblRuns")<BR> rs1.Filter = "RunID=4"<BR> Set rs2 = rs1.OpenRecordset<BR> &#039rs2 should contain only one record<BR> MsgBox rs2.RecordCount<BR> Set rs2 = Nothing: Set rs1 = Nothing<BR> Set db = Nothing<BR>End Sub<BR>&#039***************** Code End *******************

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts