473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access 2003 control source use data from external query

7 New Member
I have a complex report in Access 2003. In addition to the query that feeds the report, I have some control sources set to gather data from other queries.

One field uses the following for the control source:

=Format(nz([qryBudgetFilter edByThisFiscalY ear12.CNS/Amer12],0),"Currency")
This works fine. However when I change this to:

=Format(nz([qryBudgetFilter edByThisFiscalY ear12.CNS/Amer13],0),"Currency")
I get an error saying "Invalid bracketing of name".

The query qryBudgetFilter edByThisFiscalY ear12 is a crosstab. One of the column headings is CNS/Amer12 and one is CNS/Amer13.

Any ideas where I should look?
Sep 17 '12 #1
12 2319
twinnyfo
3,653 Recognized Expert Moderator Specialist
Carlos,

The first place I would look is to remove the slash from the query field name. since the slash can also be used for division, it is never wise to include that in a field name. This may be causing your second example above to try to divide two values.

I can't explain why it works for the first one, unles you have a control on the report that has the name "qryBudgetFilte redByThisFiscal Year12.CNS/Amer12".

Just throwing out some ideas and additional DB best practices advice.

let me know if this helps.
Sep 17 '12 #2
CarlosThomas
7 New Member
Thanks for the help. I was looking at the slash thinking it shouldn't be there. Unfortunately, I have so many nested queries that it would take me a couple of hours to remove so I am trying to avoid this.

I did try to create a new blank report with the same record source as the report in question. I then added a text control and used both of the expressions entered in my question and received similar results: the first one work, the second one produced the same error message.
Sep 17 '12 #3
CarlosThomas
7 New Member
This is the SQL from the query I am trying to use as the control source:

Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum(tblFundBudget.budget) AS SumOfbudget
  2. SELECT tblFundBudget.lineItem
  3. FROM z_fund INNER JOIN ((z_fyFund INNER JOIN this ON z_fyFund.fyID = this.fiscalYear) INNER JOIN tblFundBudget ON z_fyFund.fyfundID = tblFundBudget.fyfundID) ON z_fund.fundID = z_fyFund.fundID
  4. GROUP BY tblFundBudget.lineItem
  5. PIVOT z_fund.fundName In ("CNS/Amer11","CNS/Amer10","CNS/Amer13","AmRec","CDBG","HUD06","DOL 1","DOL10","DOE/YB","REB/YB","OWD","WAL","Unrestricted","CHA","REB","SOM","Hyams","CommCorp","OJJDP","SNAP","HUD02","DYS","CNS/Amer12","PostSec","UW");
I just found out that AmRec doesn't work either.
Sep 17 '12 #4
twinnyfo
3,653 Recognized Expert Moderator Specialist
VERY strange........

However, I can also foresee you creating queries for every Fiscal Year... I also hesitate using Cross Tab queries unless I am absolutely, positively certain that all of the potential fields are guaranteed to be in the results of the cross tab every single time. For example, if there were no values for CNS/Amer13, you would not have that field name available to other objects in your database.

According to theory, if you have data in both columns, both control sources should work on your report.

What are the typical results of your qryBudgetFilter edByThisFiscalY ear12 query?
Sep 17 '12 #5
Rabbit
12,516 Recognized Expert Moderator MVP
I'm confused as to why the first one would work. Neither one should work because
[qryBudgetFilter edByThisFiscalY ear12.CNS/Amer12]
is wrong as well. It should be
[qryBudgetFilter edByThisFiscalY ear12].[CNS/Amer12]
Notice the extra brackets to separate the query alias from the field alias.
Sep 17 '12 #6
CarlosThomas
7 New Member
The query organizes spending by line item and funder. We do create a new query for each fiscal year.

When I run the query there are some columns with no entries. CNS/Amer12 is one of these, so is AmRec. As I mentioned, CNS/Amer12 works fine on the report, but AmRec seems not to. CNS/Amer13 has plenty of entries.
Sep 17 '12 #7
CarlosThomas
7 New Member
@Rabbit - Thanks for your response. I have tried that syntax as well. When I do it that way, I am prompted to enter a value for qryBudgetFilter edByThisFiscalY ear12.
Sep 17 '12 #8
Rabbit
12,516 Recognized Expert Moderator MVP
That is most likely because the alias is incorrect. Either because you gave it a different alias, or it's because of a typo, or because the query is not actually in the record source.

If you try to reference a cross tab column for which the data does not exist in the base records, then you will get an error.
Sep 17 '12 #9
CarlosThomas
7 New Member
@Rabbit - The query I am trying to reference is different from the record source of the report. However, this does work as has worked quite well for a number of years. I just don't understand why it's not working for this specific column heading.
Sep 17 '12 #10

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

Similar topics

5
3304
by: will eichert | last post by:
Greetings. I have a problem with a combo box incorrectly displaying blank items when returning to a form from a modal form. It's fine when the main form first comes up, but gets messed up when the main form is reactivated following opening and closing a modal form. Strangely, this was not a problem until I started using my Access 2000 db in...
13
2496
by: MLH | last post by:
I have a form with two controls: !! - combo box !! - text box A button on the form tries to run this SQL when clicked... INSERT INTO BodyMsgsSent (ToWhom, BodyText) SELECT DISTINCTROW !! AS MyTargets, !! AS MyList; When the SQL runs, it fails with msg saying "Field length is too
7
2154
by: Mike Nygard | last post by:
I'm experiencing extremely slow response times in design mode of my forms since moving to Access 2003. Simply dragging a button to a different position on the form takes 30 seconds or more. The record source for my form is an ODBC passthrough query to an Oracle database. I have two XP system identically configured except that one has Access...
17
2067
by: Jana | last post by:
Howdy! I have an Access 2003 SP1 where data tables reside on a server & each workstation runs the front end locally. All 5 users are on the same version of Access. We've been having problems on our main data entry form where information input for one record will suddenly attach itself to some other record. Then, once it starts doing this,...
1
2467
by: mdk7 | last post by:
I am very new to developing forms and queries with Access. The task that I am required to complete is as follows: Build a form based user interface that displays various information from the underlining tables as well as allow for updating of this information. The problem I am having is that all the information that needs to be displaced needs...
3
4330
by: drkknightbatman | last post by:
Hi, I am pretty new to Access 2003 and SQL. I am trying to have a count show up in a query to show specific barcode prefix data between the first and the last day of the previous month. I want to do this for the remaining 5 months so I know I would change the -1 to a -2 ect. Anyways, for some reason this is not working and I get a data mismatch...
9
4483
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd like to know is the stability, speed & ease of use of both the products. I believe Access 2007 has a new file format too and that it may be...
3
3300
by: shayvillere | last post by:
I'm designing a report and cannot pull data from a query. The control gives me a #Name? error when I do a print preview. I never had this problem with Access 2000. Any ideas?
3
5152
by: HistoricVFP | last post by:
Hello, I’ve been given the task of importing .dbf files from a very old version of Visual FoxPro (version 2.1) into Access (2003). When I import the data straight to Access it errors with: External table is not in the expected format. (Error 3274) I’ve tried the following but it did not work: “To import data from a FoxPro database, use...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.