473,473 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem passing in parameter dates from form to query. (Urgent)

33 New Member
Hi there,

I have a form with which I enter data. A sort order, start date and end date.

Once the data is entered, a report is generated. But I get and error.

Error: "The Microsoft Access database engine does not recognize '[Forms]![AuditPTETotals]![startDate]' as a valid field name or expression.

This is my crosstab (AuditPTETotals_CrosstabDateRange) query which uses the data retrieved by another query (AuditPTETotalsDateRange)

Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum(AuditPTETotalsDateRange.PTEtotal) AS SumOfPTEtotal
  2. SELECT AuditPTETotalsDateRange.companyName, AuditPTETotalsDateRange.regNum, Sum(AuditPTETotalsDateRange.PTEtotal) AS [Total Of PTEtotal]
  3. FROM AuditPTETotalsDateRange
  4. GROUP BY AuditPTETotalsDateRange.companyName, AuditPTETotalsDateRange.regNum
  5. PIVOT AuditPTETotalsDateRange.description;
And this is AuditPTETotalsDateRange

Expand|Select|Wrap|Line Numbers
  1. SELECT CUSTOMER.regNum, CUSTOMER.companyName, ScrapTireType.description, ScrapTireType.PTEamount, ScrapCollectionTireType.amount, ScrapCollection.PTEtotal, ScrapCollection.Date
  2. FROM (ScrapCollection INNER JOIN CUSTOMER ON ScrapCollection.regNum = CUSTOMER.regNum) INNER JOIN (ScrapTireType INNER JOIN ScrapCollectionTireType ON (ScrapTireType.scrapTireTypeID = ScrapCollectionTireType.scrapTireTypeID) AND (ScrapTireType.scrapTireTypeID = ScrapCollectionTireType.scrapTireTypeID)) ON ScrapCollection.scrapCollectionID = ScrapCollectionTireType.scrapCollectionID
  3. WHERE (((ScrapCollection.Date) Between [Forms]![AuditPTETotals]![startDate] And [Forms]![AuditPTETotals]![endDate]));
I have used this approach in a similar way to reference forms fields in a query but this time, I am not sure what I'm doing wrong. Please help.

Thank you
Jun 4 '12 #1
3 1767
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Its been a while since I have referenced form controls in queries, but my suggestion would be:
Try removing the square brackets you have placed around Forms
Jun 4 '12 #2
Dave0291
33 New Member
Thanks for the reply but no luck. It's really weird because I have referenced forms fields in queries like this before and have had no problems. Could it be because I am using a query as my source for my cross tab query?
Jun 4 '12 #3
dsatino
393 Contributor
If it's a bound field, check to be sure that the field name and the control name aren't the same.
Jun 4 '12 #4

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

Similar topics

1
by: bhavik | last post by:
hi I have problem with attachment showing form server side. when our application run on localhost we add any attachment to mail server. if suppose we want to show that attachment we can see...
5
by: laurentc | last post by:
Dear all, I have several tables based on exactly the same fields (Key/Date/Price1/Price2). I do some statistics on the prices. However, as I have many different tables (the tables are...
1
by: bernhard.heinzel | last post by:
Hi, I got a little problem with an upload form. Everytime I post the form it only submits the filename without the path. But I need the path. So could anybody help? Here is the code: ...
1
by: Macbane | last post by:
Hi There, I have a main form that with a subform which is based on a parameter query. I have 2 controls on the main form & which are used as parameters in the query. It all works fine and...
3
by: sphinney | last post by:
I have a form with a subform. The code of the parent form alters the "Recordsource" property of a subform. Altering this property automatically triggers the subform to requery a table that has lots...
1
by: almu | last post by:
Hi all, I need help to build a set of queries in PHP/MySQL for a multiple-parameter search form, whereby the user will be able to search any number of ways (upto seven) Thanks
9
by: QCLee | last post by:
Sir can you help me to transfer my Access Query to MS excel? i have a command button on the form to export the parameter query named "HVACWindwardQuery" to excel spreadsheet and i got the codes...
1
by: mbatestblrock | last post by:
I think I have a rather advanced question that I was hoping to find some good help with. I am still pretty new to VBA and I know that doesn't help my situation here. But here is what I am trying to...
1
by: taila | last post by:
Hello everyone on this forum, I have recently started learning how to use ACCESS 2007 to create databases for work purposes. I ran into a problem while creating a form. Here's the message that...
5
by: lennih | last post by:
I've got 7 forms with different names, but some of the controls in them are the same. In some of these controls (particularly in the combo boxes) I am filtering the row source with a query. In the...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.