Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    37

    Unanswered: FilterOn = False

    Hello,

    I have a main form with a continuous subform. I am filtering the subform
    by using the following code from the main form and it works fine.

    Private Sub Form_Current()
    strWhere = "[Seder_Code]=" & G_Seder & " AND " & "[Bahoor_Code]=" & G_NameCode
    Me.SubFormFines.Form.Filter = strWhere
    Me.SubFormFines.Form.FilterOn = True
    End Sub

    The problem starts when I try to enter details on the continuous subform.
    For example when I have filtered 3 records and I want to amend the third record the cursor jumps to the first line.

    I've realized that it happens because the subform is still on FilterOn = True

    I would like to turn off the filter and to be able to change the details on the subform and still having only the 3 records that have been filtered before.

    Where can I switch off the filter and how?

    Thanks

  2. #2
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    Don't know how to do it with filters, but would you be able to do it by amending the record source of the subform itself?

    Code:
    SELECT TABLENAME.*
    FROM TABLENAME
    WHERE (((TABLENAME.Seder_Code)=[Forms]![FORMNAME]![G_Seder]) AND ((TABLENAME.Bahoor_Code)=[Forms]![FORMNAME]![G_NameCode]));
    And on the Form_Current() sub just have the line

    Me.SubFormFines.Requery

    Which will refresh the subform with each record change on the main form.

  3. #3
    Join Date
    May 2007
    Posts
    37
    I've used a different method .
    I've cancelled the main Form and turned the subform ito a Main Form abd used the following:
    strWhere = "[Seder_Code]=" & G_Seder & " AND " & "[Bahoor_Code]=" & G_NameCode
    DoCmd.OpenForm "Fines", , , strWhere
    and it works fine.
    Thank you

Posting Permissions

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