Complex Query Question

RexesOperator

Registered User.
Local time
Yesterday, 20:47
Joined
Jul 15, 2006
Messages
604
SELECT tblSites.SITENAME, tblSites.SITEPROVINCE, tblSites.SITELATDEG, tblSites.SITELATMIN, tblSites.SITELATSEC, tblSites.SITELONDEG, tblSites.SITELONMIN, tblSites.SITELONSEC, tblSites.ELEVATION, tblSites.UTMZONE, tblSites.UTMEAST, tblSites.UTMNORTH, tblSites.TOWERHT, tblSites.NBCC2, tblSites.NBCC5, tblSites.NBCC10, tblSites.NBCC30, tblSites.NBCC50, tblSites.NBCC100, tblSites.SITE2, tblSites.SITE5, tblSites.SITE10, tblSites.SITE30, tblSites.SITE50, tblSites.SITE100, tblSites.ONEALPHA, tblSites.V30, tblSites.ICING, tblSites.FLAG, tblSites.[JANDRY215%], tblSites.[JANDRY1%], tblSites.[JULDRY215%], tblSites.[JULWET215%], tblSites.DEGLESS18, tblSites.RAIN15, tblSites.[50RAIN24], tblSites.RAINANNUAL, tblSites.PCPNANNUAL,

The above is not the complete query - the rest is the mathematics used to calculate the results of a radial search. My question is - why does Access (2003) insist on putting square brackets around the highlighted variables? The rest of the variables in the list are also numeric types. And would the brackets affect the results? I get a "complex expression" error, and it is tblSites.[JANDRY215%], that seems to be causing the problem. As you can see - the data is all pulled from the same table.
 
The brackets are being added because of the symbol in the name, which should not be used. That said, they would not affect the results. We would need to know more about the situation to figure out the actual cause of the error.
 
That's what I first thought - I will fix that and play around with it for while.

The setup I have is a search menu that allows for a number of options - including a radial search. When the user clicks on "Radial Search" (a command button that runs a macro) an unbound form opens where the user enters coordinates and distance. The user clicks on a second command button on the unbound form. THAT macro opens a report based on the above query. So far so good. What's weird is the query works when I run it from the query design menu and the report runs from both the object list AND the macro design. When I attach the macro to the second command button everything halts at the "complex expression" error.
 
What's even weirder is I used a copy of the form from another copy of the db I am working on. THAT form worked. The only thing that changed was the unbound form. At least it works though.

Thanks Access for adding to the mysteries of life!
 

Users who are viewing this thread

Back
Top Bottom