Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
gevonden opA known problem with Access crosstab queries is that references to form control values in WHERE clauses can and do fail, resulting in the error message you quoted - 'Access does not recognise xxxx as a valid field name or expression'. It often arises when adapting a SELECT query to become a CROSSTAB query - the Select WHERE clause works fine from the Query editor window, but change the query type to Crosstab and the same WHERE clause often fails.
This lack of recognition of form control references also occurs when running non-crosstab queries from VBA code, though in that case VBA returns a different error message: 'too few parameters - expected 1'.
It may well be that the field you mentioned which was missing - even though it appears to have nothing to do with your crosstab - is the sole cause of the failure of your report, in which case you don't need to do anything at all about your use of the form control reference. But, if you continue to experience the failure you mentioned in post #1 I'd replace the direct form control value, as I explain below.
http://bytes.com/topic/access/answers/873154-access-does-not-recognize-valid-field-name
Zoiets?
TRANSFORM Nz(Count(Aanmeldingsoort_ID),0) AS Aantal
SELECT tblAanmeldingSoorten.Aanmeldingsoort
FROM tblAanmeldingSoorten INNER JOIN tblAanmeldingen ON tblAanmeldingSoorten.AanmeldingsoortID = tblAanmeldingen.Aanmeldingsoort_ID
WHERE (((Year([Datum]))=Year(Date()) Or (Year([Datum]))=Year(Date())-1))
GROUP BY tblAanmeldingSoorten.Aanmeldingsoort, [B][Field1][/B]/[B][Field2][/B]*100
PIVOT Year([Datum]);
En je eigen antwoord:Ik vraag mij sterk af hoe je, om een nieuw veld te formuleren Percentage: Field 1/Field 2, veld 1 en veld 2 specificieert in die formule??
Dus de formule die je zou willen maken, zal nooit kunnen werken. Op het moment dat de kruistabel wordt gegenereerd, bestaan de velden nog niet. Je krijgt dus altijd een foutmelding, zelfs als je de jaartallen met de hand zou invullen.Want die verschillen toch steeds van naam!
GROUP BY tblAanmeldingSoorten.Aanmeldingsoort, [2010]/[2009]*100
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.