Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    233

    Unanswered: Filter Sub Reports based on Main report Selection

    I have attached a screenshot that may help explain what I am trying to achieve.

    I have a Main Form and a Sub Form:

    Alongside each record in the main form is a button. Currently called “Code”. On each record there is a field called UPL in the Main Form and the subform.

    The idea is the user can click in this field and then click the adjacent button called Code.

    It would then search the subform in the Corresponding UPL field and set the focus to that record. The next step would be to filter on the field and record that it had set focus on.

    Basically, creating a filter in the subform of the selected record from the main form.

    I am going round in circles can anyone help with this one.
    Attached Files Attached Files

  2. #2
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    requery the subform based on the criteria of the upl code textbox
    or filter the subform based on that criteria

    behind the button for code put something like

    dim myupl
    myupl = forms!frmmain!txtupl (or the name of the control)

    forms!frmmain!frmsubform.form.recordsource = "select * from some table where upl = " & myupl
    forms!frmmain!frmsubform.form.requery
    Dale Houston, TX

  3. #3
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    It does workbut maybe not exactly like you wanted it to - that code does allow for a a filter or requery based on a value of the current record - I will try to look at the image though
    Dale Houston, TX

  4. #4
    Join Date
    May 2003
    Location
    UK
    Posts
    233
    Fantastic - Works a treat.
    Thanks for that.

Posting Permissions

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