Report to display Query Criteria through a form

Jolted_Chicken

Registered User.
Local time
Today, 19:06
Joined
Nov 7, 2002
Messages
15
For a query, I have to criteria points to a Form
[Forms]![fmrMonthlyReports]![ComboMonth]
which is a combo box (Value List: 1;2;3;4;5....12)

In the report that calls that query, i have a label that displays this criteria
=[Forms]![fmrMonthlyReports]![ComboMonth]

When the form closes, the report no longer displays the label.

Is there any code that i can do so that even if the form closes, the report can still display the month?
 
Have a Text Label on the report be set to the value of the control on the form when the report is opened.

Code:
Private Sub Report_Open(Cancel As Integer)

Me.TheLabel.Caption =[Forms]![fmrMonthlyReports]![ComboMonth] 

End Sub
 
Thanx for your response.
But i get a run-time error with that code.

Code:
Private Sub Report_Open(Cancel As Integer)

Me.txtMonth.Caption =[Forms]![fmrMonthlyReports]![ComboMonth] 

End Sub

the label is unbounded called txtMonth

I'm a bit of a newbie with access.

Another question:
My report also have a chart that displays the results of the query.
Is it possible to pass the parameters to a temp variable from the form before passing to the query? When the form closes, the chart disappears.
 
You are using a text box, not label. I can tell because you said you were using an unbounded label. Labels don't even give you that option. It does have a Caption property, though. Right-mouse click on control and select Change To and change it to a label.
 

Users who are viewing this thread

Back
Top Bottom