Insert query result into form

  • Thread starter Thread starter Sasha
  • Start date Start date
S

Sasha

I'm stumped.

I'm trying to build a report that shows the amounts calculated in a query.
The query works just fine, returns the information I have specified and
totals up the amounts for the account.

In my summary report, I have inserted an unbound text box and under
properties I went to Control Source, pointed to my query and pointed to the
result.

[pb 01 recording]![Sum Of amount]

When I go to view the report, the value returned in the cell is #Name.

What am I doing wrong?

Much thanks!
 
Sasha

What happens if you open the list of available fields in your report (design
mode) and drag down the [Sum Of Amount] field?

I'm curious, in my queries that total, that would be spelled [SumOfAmount],
without the spaces. Did you modify the title of that field in the query?
 
Jeff, I don't have a list of fields available in the report, the field list
option is grayed out in the menu.. The report was meant to summarize the
results of 8 queries, so I put in 8 unbound text boxes and tried to set
their control source to show results from the different queries.
When I try to build this same summary report using the wizard and trying to
go right to the queries for the fields, I get the following error message:
"You have chosen fields from record sources which the wizard can't connect.
You may have chosen fields from a table or from a query based on that table.
If so, try choosing fields from only the table or only the query."

When I use only 1 query, it works. When I try to use all 8 query results.
It doesn't.

What actually shows up when in the unbound window is =[pb 01 recording]![Sum
Of amount]

When I change it to =[pb 01 recording]![SumOfamount]
I get an error message as follows: "The expression On Format you entered as
the event property setting produced the following error: The object doesn't
contain the Automation object 'pb 01 recording.'."

I did not modify the title in the query. I am using Access 2000.




Jeff Boyce said:
Sasha

What happens if you open the list of available fields in your report
(design
mode) and drag down the [Sum Of Amount] field?

I'm curious, in my queries that total, that would be spelled
[SumOfAmount],
without the spaces. Did you modify the title of that field in the query?

--
Good luck

Jeff Boyce
<Access MVP>

Sasha said:
I'm stumped.

I'm trying to build a report that shows the amounts calculated in a
query.
The query works just fine, returns the information I have specified and
totals up the amounts for the account.

In my summary report, I have inserted an unbound text box and under
properties I went to Control Source, pointed to my query and pointed to the
result.

[pb 01 recording]![Sum Of amount]

When I go to view the report, the value returned in the cell is #Name.

What am I doing wrong?

Much thanks!
 
Sasha

I am not very clear on what you are doing. Your original post mentioned one
textbox. Your reply mentioned 8 different queries and 8 different
textboxes.

Maybe this is too complex to troubleshoot all at once. What happens if you
step back and look at a single query/report combination?

Give this a try:
Pick just one of the 8 queries. Run it as a query. Does it generate the results you expect?
Using the report wizard for that one query, try to put that one query's
field/result on the report. Does it work like you'd expect?

If both of those worked, and if I'm understanding your situation, you have 8
unrelated (they don't need/know about each other) queries. So, create the 8
unrelated reports, one based on each query. Satisfy yourself they each/all
work as stand-alones. Then create an "empty" 9th report, and insert,
one-by-one, the 8 reports as "sub-reports".

Or am I still confused about your situation?

--
Good luck

Jeff Boyce
<Access MVP>



Sasha said:
Jeff, I don't have a list of fields available in the report, the field list
option is grayed out in the menu.. The report was meant to summarize the
results of 8 queries, so I put in 8 unbound text boxes and tried to set
their control source to show results from the different queries.
When I try to build this same summary report using the wizard and trying to
go right to the queries for the fields, I get the following error message:
"You have chosen fields from record sources which the wizard can't connect.
You may have chosen fields from a table or from a query based on that table.
If so, try choosing fields from only the table or only the query."

When I use only 1 query, it works. When I try to use all 8 query results.
It doesn't.

What actually shows up when in the unbound window is =[pb 01 recording]![Sum
Of amount]

When I change it to =[pb 01 recording]![SumOfamount]
I get an error message as follows: "The expression On Format you entered as
the event property setting produced the following error: The object doesn't
contain the Automation object 'pb 01 recording.'."

I did not modify the title in the query. I am using Access 2000.




Jeff Boyce said:
Sasha

What happens if you open the list of available fields in your report
(design
mode) and drag down the [Sum Of Amount] field?

I'm curious, in my queries that total, that would be spelled
[SumOfAmount],
without the spaces. Did you modify the title of that field in the query?

--
Good luck

Jeff Boyce
<Access MVP>

Sasha said:
I'm stumped.

I'm trying to build a report that shows the amounts calculated in a
query.
The query works just fine, returns the information I have specified and
totals up the amounts for the account.

In my summary report, I have inserted an unbound text box and under
properties I went to Control Source, pointed to my query and pointed to the
result.

[pb 01 recording]![Sum Of amount]

When I go to view the report, the value returned in the cell is #Name.

What am I doing wrong?

Much thanks!
 
AHHHAA! Eureka!

You've answered my question! I was mistaken in assuming that I could
insert multiple individual query results into a report. Now I understand
that I need to use sub reports and all works as I want.

Much thanks!





Jeff Boyce said:
Sasha

I am not very clear on what you are doing. Your original post mentioned
one
textbox. Your reply mentioned 8 different queries and 8 different
textboxes.

Maybe this is too complex to troubleshoot all at once. What happens if
you
step back and look at a single query/report combination?

Give this a try:
Pick just one of the 8 queries. Run it as a query. Does it generate the results you expect?
Using the report wizard for that one query, try to put that one query's
field/result on the report. Does it work like you'd expect?

If both of those worked, and if I'm understanding your situation, you have
8
unrelated (they don't need/know about each other) queries. So, create the
8
unrelated reports, one based on each query. Satisfy yourself they each/all
work as stand-alones. Then create an "empty" 9th report, and insert,
one-by-one, the 8 reports as "sub-reports".

Or am I still confused about your situation?

--
Good luck

Jeff Boyce
<Access MVP>



Sasha said:
Jeff, I don't have a list of fields available in the report, the field list
option is grayed out in the menu.. The report was meant to summarize the
results of 8 queries, so I put in 8 unbound text boxes and tried to set
their control source to show results from the different queries.
When I try to build this same summary report using the wizard and trying to
go right to the queries for the fields, I get the following error
message:
"You have chosen fields from record sources which the wizard can't connect.
You may have chosen fields from a table or from a query based on that table.
If so, try choosing fields from only the table or only the query."

When I use only 1 query, it works. When I try to use all 8 query
results.
It doesn't.

What actually shows up when in the unbound window is =[pb 01 recording]![Sum
Of amount]

When I change it to =[pb 01 recording]![SumOfamount]
I get an error message as follows: "The expression On Format you entered as
the event property setting produced the following error: The object doesn't
contain the Automation object 'pb 01 recording.'."

I did not modify the title in the query. I am using Access 2000.




message
Sasha

What happens if you open the list of available fields in your report
(design
mode) and drag down the [Sum Of Amount] field?

I'm curious, in my queries that total, that would be spelled
[SumOfAmount],
without the spaces. Did you modify the title of that field in the query?

--
Good luck

Jeff Boyce
<Access MVP>

I'm stumped.

I'm trying to build a report that shows the amounts calculated in a
query.
The query works just fine, returns the information I have specified
and
totals up the amounts for the account.

In my summary report, I have inserted an unbound text box and under
properties I went to Control Source, pointed to my query and pointed
to
the
result.

[pb 01 recording]![Sum Of amount]

When I go to view the report, the value returned in the cell is #Name.

What am I doing wrong?

Much thanks!
 
Back
Top