Open Report based on Values in Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rkm2
    New Member
    • Nov 2007
    • 1

    Open Report based on Values in Form

    I currently have a form "UserSearchForm " which allows a user to select values from several different unbound combo boxes in the header section and press a search command which filters the list in the detail section.

    I want to be able to create a button which previes a LabelsReport based on the filtered list in the form. Any thoughts?
  • Jim Doherty
    Recognized Expert Contributor
    • Aug 2007
    • 897

    #2
    Originally posted by rkm2
    I currently have a form "UserSearchForm " which allows a user to select values from several different unbound combo boxes in the header section and press a search command which filters the list in the detail section.

    I want to be able to create a button which previes a LabelsReport based on the filtered list in the form. Any thoughts?
    Whatever SQL string value your search form is filtering its records by can be passed to the report so that it mirrors that when it opens.

    In the OnOpen event of the report try entering this into the code window

    Code:
     
    Me.Filter = Forms!UserSearchForm.Filter
    Me.FilterOn = True
    If you want to 'see' the value of of your forms filter command at runtime prior to it opening your report then simply place an unbound textbox on the search form somewhere and set its controlsource to this

    Code:
    =[Form].Filter
    Regards

    Jim :)

    Comment

    Working...