469,304 Members | 2,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

Access Report / Sub report with parameters



I have a report with a sub report for an income / expense report for
church. My expense report is the sub report.
My question is, when I run the report, it prompts me 2-3 times for the
parameters of the expense report. Is there a way around this annoyance?
Thank you for your help.

Scott

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
14 10314
How are you defining these parameters?

"Scott Gorman" <sg***@comcast.net> wrote in message
news:41**********@127.0.0.1...


I have a report with a sub report for an income / expense report for
church. My expense report is the sub report.
My question is, when I run the report, it prompts me 2-3 times for the
parameters of the expense report. Is there a way around this annoyance?
Thank you for your help.

Scott

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #2
In the query, I have a column with the following entries.

Field- Month([Date])
Sort- Expression
Criteria- [Expense Report for month: 1-12: ]

When I run this query on its own, it works fine. The problem seems to be
when I have this query in my report as a sub report. It currently is
prompting me 2 times for this data. Not sure how I changed it, but it
was prompting me 3 times before.
Thanks,
Scott

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3
I'd suggest you take the criteria line out of the query.
Instead, put a textbox on your main form to enter the month you want.
Then use the LinkMasterFields and LinkChildFields properties of your subform
control to take care of your filtering.
"Scott Gorman" <sg***@comcast.net> wrote in message
news:41**********@127.0.0.1...
In the query, I have a column with the following entries.

Field- Month([Date])
Sort- Expression
Criteria- [Expense Report for month: 1-12: ]

When I run this query on its own, it works fine. The problem seems to be
when I have this query in my report as a sub report. It currently is
prompting me 2 times for this data. Not sure how I changed it, but it
was prompting me 3 times before.
Thanks,
Scott

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #4


I am not sure how to do that. Could you possibly help me to get that
started. I sure appreciate your help

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

"Scott Gorman" <sg***@comcast.net> wrote in message
news:42**********@127.0.0.1...


I am not sure how to do that. Could you possibly help me to get that
started. I sure appreciate your help

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #6
1. I'd suggest you take the criteria line out of the query.
2. Instead, put a textbox on your main form to enter the month you want.
3. Then use the LinkMasterFields and LinkChildFields properties of your
subform
control to take care of your filtering

Sorry, I'm not sure where I need to be clearer.
Which line of my instructions is unclear?
Could you be more specific in the help you'd like?
"Scott Gorman" <sg***@comcast.net> wrote in message
news:42**********@127.0.0.1...


I am not sure how to do that. Could you possibly help me to get that
started. I sure appreciate your help

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #7

Sorry for being so unclear.
OK. I have taken the parameter out of the query. Now, when I open the
report, I get all the dates, and do not get the parameters I want.
I am trying to create a form that will open when the report is opened
that I can put the date range I want to see.
I can not figure out how to link the "Date" form to the query and then
to the report to tie it all together.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #8
OK, that's quite different from the report/subreport setup you first
described.

Do you have parameters other than the date?
Do you have a form, perhaps with a button, from which you open this report?
Or are you opening it directly from the database window?

"Scott Gorman" <sg***@comcast.net> wrote in message
news:42**********@127.0.0.1...

Sorry for being so unclear.
OK. I have taken the parameter out of the query. Now, when I open the
report, I get all the dates, and do not get the parameters I want.
I am trying to create a form that will open when the report is opened
that I can put the date range I want to see.
I can not figure out how to link the "Date" form to the query and then
to the report to tie it all together.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #9
The only criteria I am pulling out is the date range
I have a switchboard from which to open the report from.
I was able to create a form that I am able to have open when the report
opens to input the parameters in now. Seems to be working ok.
The last thing I would like to be able to do is....
I have a text box in the report that prompts to "input last months
balance". This prompt comes up after my form to input the date range. If
I add this to my form, how do I link it to fill in on the report?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #10
Here's one way:
Put a label on the report.
In the report_open event, set the label's caption to the value of the
textbox:
MyLabel.Caption = Forms!InputForm!txtBalance

HTH

"Scott Gorman" <sg***@comcast.net> wrote in message
news:42**********@127.0.0.1...
The only criteria I am pulling out is the date range
I have a switchboard from which to open the report from.
I was able to create a form that I am able to have open when the report
opens to input the parameters in now. Seems to be working ok.
The last thing I would like to be able to do is....
I have a text box in the report that prompts to "input last months
balance". This prompt comes up after my form to input the date range. If
I add this to my form, how do I link it to fill in on the report?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #11


MyLabel.Prevbalance = Forms!Date!balance

This is the code I placed in the On open event procedure.
Prevbalance is the name of the text box, and balance is the name of the
box on the form where you input the previous balance.
When it runs, it errors out and says - run time error '424' Object
required.
Can you tell me where I went wrong.
Thanks for you patience with me...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #12
I think you've got the syntax on the right side of the equals sign right,
except for my advice in # 4 below. But there are several problems on the
left side.

1. My instructions were to place a label on the report.
It looks as if you used a textbox.
Use a label.

2. When giving instructions such as "Create a Label. Set its properties
thus:", it's common to refer to the label as MyLabel.
The expectation is that the user will substitute the name of his/her
own label.

3. I instructed you to use the Caption property of the label.
If you have a label named Prevbalance, the syntax would be
Prevbalance.Caption
(If Prevbalance is a textbox, this will cause an error, because a
textbox doesn't have a Caption property.)

Since you have nothing on your report named MyLabel, and have an
instruction to Access to do something to MyLabel, it's understandable that
Access says "Object required", i.e. "I/you need an object named MyLabel."

4. This is not something I'd told you about before, but it looks as if your
form is named Date. Date is a reserved word in Access, which means Access
may have its own opinion as to the meaning of that term, which may well not
co-incide with yours. Personally, I avoid this problem by always starting
my form names with frm, so I would have called this form frmDate. You could
just as well name it DateForm, or DateRange. But naming it (or anything
else) just Date is asking for trouble you don't need.
"Scott Gorman" <sg***@comcast.net> wrote in message
news:42**********@127.0.0.1...


MyLabel.Prevbalance = Forms!Date!balance

This is the code I placed in the On open event procedure.
Prevbalance is the name of the text box, and balance is the name of the
box on the form where you input the previous balance.
When it runs, it errors out and says - run time error '424' Object
required.
Can you tell me where I went wrong.
Thanks for you patience with me...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #13


Thank you. I am beginning to get it through my thick head.

I was able to get the label to work, and I have renamed my form to
dateform.
What would the syntax be to set the format so it would look like the
following. $1,111.11 ?
Also, I had a formula set in another text box to take the previous
balance + income - expenses to come up with the new balance forward.
Seems as though I am getting an error now that I replaced my old text
box with the new label.
Should I create this formula in syntax code as well?

Thank you again,

Scott

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #14
The Access Help file has a pretty good description of the Format() function.
I suggest you look there to learn its syntax.

Now that you have a label instead of a textbox, you'll need to use its
..Caption property whenever you want to reference the text it displays. This
may be what's causing the error in your calculations.
"Scott Gorman" <sg***@comcast.net> wrote in message
news:42**********@127.0.0.1...


Thank you. I am beginning to get it through my thick head.

I was able to get the label to work, and I have renamed my form to
dateform.
What would the syntax be to set the format so it would look like the
following. $1,111.11 ?
Also, I had a formula set in another text box to take the previous
balance + income - expenses to come up with the new balance forward.
Seems as though I am getting an error now that I replaced my old text
box with the new label.
Should I create this formula in syntax code as well?

Thank you again,

Scott

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Joris Kempen | last post: by
2 posts views Thread by Tom Weddell | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.