By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Interactive Parameters

DAF LAD
P: 8
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_GalaSelection" and the combo box name is "Gala"

Thanks in advance
Mar 9 '08 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,597
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_GalaSelection" and the combo box name is "Gala"

Thanks in advance
  1. In qry_ASA, in the [Gala] Field, type this in the Criteria Row:
    Expand|Select|Wrap|Line Numbers
    1. Forms!frm_GalaSelection![Gala]
  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:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Gala_AfterUpdate()
    2.   If Not IsNull(Me![Gala]) Then
    3.     DoCmd.OpenReport "<Your Report Name>", acViewPreview, , , acWindowNormal
    4.   End If
    5. End Sub
  4. You can also specify the Criteria in the OpenReport Line itself, and not in qry_ASA:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Gala_AfterUpdate()
    2.   If Not IsNull(Me![Gala]) Then
    3.     DoCmd.OpenReport "Report1", acViewPreview, , "[Gala] = #" & Me![Gala] & "#"
    4.   End If
    5. End Sub
Mar 9 '08 #2

DAF LAD
P: 8
thanks, works perfectly
Mar 10 '08 #3

ADezii
Expert 5K+
P: 8,597
thanks, works perfectly
You are quite welcome.
Mar 10 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.