Access 2010 query won't recognize criteria from Form's text box

jmcdonnell57

New member
Local time
Today, 05:19
Joined
May 7, 2014
Messages
3
I've been writing queries in the following format for years in Access 2003, but having recently transistioned to Access 2010, I've found the following sql doesn't work.
transform
sum(s.value)
SELECT
s.sn, s.ln, s.pn, s.id, s.lat, s.point, s.supply_type, s.used, s.real, s.code, c.name
FROM
supply_points s
, codes c
WHERE
s.code = c.code
and s.id is not null
and s.code = 1075
and s.month >=[forms]![main]![gppstart ]
group by
s.sn, s.ln, s.pn, s.id, s.lat, s.point, s.supply_type, s.used, s.real, s.code, c.name
pivot
s.month

In Access 2010, this query returns the following error message:
the Microsoft Access database does not recognize '[forms]![main]![gppstart]' as a valid field name or expression
Is this a common phenomena in Access 2010?
 
That criteria should work just fine. Is there supposed to be a space after gppstart? =[forms]![main]![gppstart ]
 
No, that's a typo. I normally don't use brackets when the object names don't have spaces.

I've tried the query both ways, with and without brackets, with and without typos...it still can't find the text box.

Thanks for looking at my query--I don't see anything wrong with it either. I'm wondering if there is a new collection reference in Access 2010.
 
I'm wondering if there is a new collection reference in Access 2010.
That's quite an assertion without proof. You haven't supplied any information about the basic debugging steps: 1. DO you in fact have such a control on your form, and you have verified its - and the main form's - name property? 2. You have, in the query designer, made a simple query where you used the expression builder to create the reference to that control, and that too produces an error?
 

Users who are viewing this thread

Back
Top Bottom