Pass through error 3070

J

Jeff C

I am using a crosstab query as a control source for a report. The column of
the crosstab is the year field of a dataset, the product of which is
format([mydate],"yy").

Each year I have to modify the report because it is calculating on the year
field (currently 09 and 10)

I use VB to loop through a recordset of facilities as criteria for the
crosstab and report. This early in the year some facilities have no year
"10" so I am getting the error 3070 does not recognize [10] as a fieldname.

What can I use in the code to just move on through this error without
manually clicking the OK button on the error message? I already have
"setwarnings = False".

Thanks for any assistance.
 
A

Arvin Meyer [MVP]

In your crosstab query's design view, right-click and choose properties, Now
in the Column Heading property, type in each of the column headings that you
want. That will ensure that the column exists.
 
J

Jeff C

--
Jeff C
Live Well .. Be Happy In All You Do


Arvin Meyer said:
In your crosstab query's design view, right-click and choose properties, Now
in the Column Heading property, type in each of the column headings that you
want. That will ensure that the column exists.
Beautiful! Never knew that was there .. what a find. Thanks very much!
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Jeff C said:
I am using a crosstab query as a control source for a report. The column
of
the crosstab is the year field of a dataset, the product of which is
format([mydate],"yy").

Each year I have to modify the report because it is calculating on the
year
field (currently 09 and 10)

I use VB to loop through a recordset of facilities as criteria for the
crosstab and report. This early in the year some facilities have no year
"10" so I am getting the error 3070 does not recognize [10] as a
fieldname.

What can I use in the code to just move on through this error without
manually clicking the OK button on the error message? I already have
"setwarnings = False".

Thanks for any assistance.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top