Interactive Parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DAF LAD
    New Member
    • Oct 2006
    • 8

    #1

    Interactive Parameters

    Hi All,

    I have a dtatbase that stores alot of data. I have a query that brings back all the data that i need for the reports I need to produce. These reports that I produce are organised by date. I currently have a parameter set up so that when the report is run the default message box appears asking you to enter the date for the report. This will then bring back only the results that refer to that date.

    However if you enter an incorrect date then the report will show nothing.

    I would like to create a form that has a dropdown combo box (that list all the selectable dates from a table i already have) that when a value is selected that is the answer to the query parameter and the report is produced.

    I have read the "help file" on microsofts website, that was not much help at all. I have also read a few forums explaining how to use interactive parameter forms but have had no success.

    Can anyone give me any hints/help??

    The query is named "qry_ASA" and the parameter value is for the field "Gala"
    The form I would like to use is named "frm_GalaSelect ion" and the combo box name is "Gala"

    Thanks in advance
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by DAF LAD
    Hi All,

    I have a dtatbase that stores alot of data. I have a query that brings back all the data that i need for the reports I need to produce. These reports that I produce are organised by date. I currently have a parameter set up so that when the report is run the default message box appears asking you to enter the date for the report. This will then bring back only the results that refer to that date.

    However if you enter an incorrect date then the report will show nothing.

    I would like to create a form that has a dropdown combo box (that list all the selectable dates from a table i already have) that when a value is selected that is the answer to the query parameter and the report is produced.

    I have read the "help file" on microsofts website, that was not much help at all. I have also read a few forums explaining how to use interactive parameter forms but have had no success.

    Can anyone give me any hints/help??

    The query is named "qry_ASA" and the parameter value is for the field "Gala"
    The form I would like to use is named "frm_GalaSelect ion" and the combo box name is "Gala"

    Thanks in advance
    1. In qry_ASA, in the [Gala] Field, type this in the Criteria Row:
      [CODE=text]Forms!frm_GalaS election![Gala][/CODE]
    2. Assuming your Report is named Report1, make sure its Record Source is set to qry_ASA.
    3. In the AfterUpdate() Event of the Gala Combo Box, place the following code:
      [CODE=vb]
      Private Sub Gala_AfterUpdat e()
      If Not IsNull(Me![Gala]) Then
      DoCmd.OpenRepor t "<Your Report Name>", acViewPreview, , , acWindowNormal
      End If
      End Sub[/CODE]
    4. You can also specify the Criteria in the OpenReport Line itself, and not in qry_ASA:
      [CODE=vb]Private Sub Gala_AfterUpdat e()
      If Not IsNull(Me![Gala]) Then
      DoCmd.OpenRepor t "Report1", acViewPreview, , "[Gala] = #" & Me![Gala] & "#"
      End If
      End Sub[/CODE]

    Comment

    • DAF LAD
      New Member
      • Oct 2006
      • 8

      #3
      thanks, works perfectly

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by DAF LAD
        thanks, works perfectly
        You are quite welcome.

        Comment

        Working...