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

Control Source gives #Name? error

P: 4
Trying to create a report from several Query sources, I specify the control source as :

=[Query Name]![Field Name]

All I get is #Name? in the report. I am trying to create the report using fields from multiple queries.
2 Weeks Ago #1

✓ answered by twinnyfo

Hardy,

Your response assumes I use the report wizard.

If your report is unbound (i.e. has no Record Source), then, if you click on a Control’s Control Source, it will list everything in the Database because the Report doesn’t know where to find its data. It does not, however, enable you to pick and choose whatever fields from whatever tables and queries—just because it is confused. It does allow you to designated controls from other forms/reports, but those forms/reports must be open at the time of your running your report—and it typically not the “best” way to do it, although it is possible.

The typical construction of any report is to designate a record source—whether it be a table or a query—and assign that to the Report’s Record Source. Then, you are free to choose any of the fields from that record source to display on your report.

I don’t know anything about your experience with Access. However, I’ve been doing this for about 25 years. In order for a report to display data, you. Need a record source or you go through the complex and cumbersome task of using Domain Functions (DLookup, DSum, etc.), which is not usually recommended.

FWIW, your solution requires you to create a query that consolidates your required data and assign that query to your report’s record source.

Share this Question
Share on Google+
7 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,128
Hardy31,

Welcome to Bytes!

You cannot create a report frommultiple query sources; you can only have one Record Source for your Report.

This is the cause of your problem.
2 Weeks Ago #2

P: 4
Many thanks twinnyfo. I had a feeling I was going to receive this answer, but I didn't really believe such a product would be this limited!!
2 Weeks Ago #3

twinnyfo
Expert Mod 2.5K+
P: 3,128
Hardy31:
I didn't really believe such a product would be this limited!!
I'm not sure what you mean by this. Why would one think that a report could pick and choose data from various locations? A Report gathers specific data (either through a table or query) and presents it in an orderly fashion. This is not a limitation.
2 Weeks Ago #4

NeoPa
Expert Mod 15k+
P: 31,273
Hardy:
I had a feeling I was going to receive this answer, but I didn't really believe such a product would be this limited!!
Unfortunately it seems I'll have to explain that the clear issue here is not where you believe it is, in Access. It's with you're understanding and appreciation of databases and such related development tools. It's hard to imagine where you might have developed the idea that a field or property named RecordSource would ever be used to specify multiple record sources. If it were to have such a capability (senseless though that certainly is) then surely it would be inappropriately named at the very least.

We may be able to be of more assistance if you can manage to explain what it is you're trying to do more clearly. Development work in any arena is necessarily complicated and thus requires very precise terminology for best communication. Vague references to multiple queries being referenced doesn't really get us anywhere.
2 Weeks Ago #5

P: 4
TwinnyFo:

Your response appears to assume the use of the Report Wizard tool. If the Expression Builder on the Control Source shows my database, which in turn breaks down to 'Tables', Queries' and 'Reports' and then having selected a specific file, allows one to specify a particular field, as in [ReportName]!{FieldName], then I would assume [ReportName]![FieldName2] would be as valid as [ReportName2]![FieldName], in that they are unique and part of a single database.
2 Weeks Ago #6

twinnyfo
Expert Mod 2.5K+
P: 3,128
Hardy,

Your response assumes I use the report wizard.

If your report is unbound (i.e. has no Record Source), then, if you click on a Control’s Control Source, it will list everything in the Database because the Report doesn’t know where to find its data. It does not, however, enable you to pick and choose whatever fields from whatever tables and queries—just because it is confused. It does allow you to designated controls from other forms/reports, but those forms/reports must be open at the time of your running your report—and it typically not the “best” way to do it, although it is possible.

The typical construction of any report is to designate a record source—whether it be a table or a query—and assign that to the Report’s Record Source. Then, you are free to choose any of the fields from that record source to display on your report.

I don’t know anything about your experience with Access. However, I’ve been doing this for about 25 years. In order for a report to display data, you. Need a record source or you go through the complex and cumbersome task of using Domain Functions (DLookup, DSum, etc.), which is not usually recommended.

FWIW, your solution requires you to create a query that consolidates your required data and assign that query to your report’s record source.
2 Weeks Ago #7

P: 4
Thanks for your response Twinnyfo.
I have been creating tables, queries and reports for somebody who is not too au fait with computers, but wants his company's books on computer for his accountant, rather than all manually recorded.
I chose Access over Eexcel so he could not 'wipe out' chunks of records. everything was going very well, until I came to trying to create a trading balance sheet!
Although I have encountered Access as far back as I care to remember, this is the first time I have actually tried to create anything with it.
I am content to create the trading balance sheet manually for him when he requires it. Currently, I have him going through a learning process to enter records and run queries and reports I created for him. He wants to enter his 2019/20 records in earnest very soon, so I have also provided him with other files for 2019/20 and 2020/21.
Once again, many thanks for your responses.
2 Weeks Ago #8

Post your reply

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