I came across this How Do I Sequentially Number Records in an Access Query
in order to do what I was trying to do based on this stackoverflow question I posted (which I never got to do what I was after) but each time that I try to add the AS Counter to the query I get
The expression you entered contains invalid syntax
You may have entered an operand without an operator
using the following sql:
SELECT Maintable.NumBR, Maintable.*, [Ehow] AS Expr1
FROM Maintable
WHERE (((Maintable.[NumBR])=""
Or (Maintable.[NumBR]) Like "3101"
Or (Maintable.[NumBR]) Like "3541"
Or (Maintable.[NumBR]) Like "4381"
Or (Maintable.[NumBR]) Like "AS3281"
Or (Maintable.[NumBR]) Like "4260"
Or (Maintable.[NumBR]) Like "4315"
Or (Maintable.[NumBR]) Like "4330"
Or (Maintable.[NumBR]) Like "4382"
Or (Maintable.[NumBR]) Like "9410"
Or (Maintable.[NumBR]) Like "9570"
Or (Maintable.[NumBR]) Like "AS3710"
Or (Maintable.[NumBR]) Like "AS4450"
Or (Maintable.[NumBR]) Like "K400"
Or (Maintable.[NumBR]) Like "3100"
Or (Maintable.[NumBR]) Like "3130"
Or (Maintable.[NumBR]) Like "3280"
Or (Maintable.[NumBR]) Like "3495"
Or (Maintable.[NumBR]) Like "3540"
Or (Maintable.[NumBR]) Like "3610"
Or (Maintable.[NumBR]) Like "3700"
Or (Maintable.[NumBR]) Like "4110"
Or (Maintable.[NumBR]) Like "4200")
AND (([Ehow])=DCount("[NumBR]","[Maintable]"," [NumBR] <= " & [NumBR])));
EDIT the question posed in the previous stackoverflow question answers this question.
The AS Counter phrase is not needed in your query. In the linked example, that’s added to the SELECT statement to alias the column; in your example you’re working with the WHERE clause, so that AS phrase wouldn’t do anything (and is actually invalid).