Interactive Parameters  | Newbie | | Join Date: Oct 2006 Location: England, UK
Posts: 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
|  | Expert | | Join Date: Apr 2006 Location: Philadelphia
Posts: 5,224
| | | re: Interactive Parameters Quote:
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_GalaSelection" and the combo box name is "Gala"
Thanks in advance - In qry_ASA, in the [Gala] Field, type this in the Criteria Row:
- Forms!frm_GalaSelection![Gala]
- Assuming your Report is named Report1, make sure its Record Source is set to qry_ASA.
- In the AfterUpdate() Event of the Gala Combo Box, place the following code:
-
Private Sub Gala_AfterUpdate()
-
If Not IsNull(Me![Gala]) Then
-
DoCmd.OpenReport "<Your Report Name>", acViewPreview, , , acWindowNormal
-
End If
-
End Sub
- You can also specify the Criteria in the OpenReport Line itself, and not in qry_ASA:
- Private Sub Gala_AfterUpdate()
-
If Not IsNull(Me![Gala]) Then
-
DoCmd.OpenReport "Report1", acViewPreview, , "[Gala] = #" & Me![Gala] & "#"
-
End If
-
End Sub
|  | Newbie | | Join Date: Oct 2006 Location: England, UK
Posts: 8
| | | re: Interactive Parameters
thanks, works perfectly
|  | Expert | | Join Date: Apr 2006 Location: Philadelphia
Posts: 5,224
| | | re: Interactive Parameters Quote:
Originally Posted by DAF LAD thanks, works perfectly You are quite welcome.
|  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,537 network members.
|