test for error in if statement

R

Randal

I have a cross tab query that provides the fields for an append query. It
works fine until there is no data to create one of the fields then the 2nd
query errors out looking for the field. Is it possible to test for this
error in the second query and have the second query supply dummy data? For
example:
iif( error exists, 5, [Field1])
 
M

[MVP] S.Clark

No. To work around this, you can create a semi-permanant table of which you
write the crosstab into. This guarantees that all of the expected fields
names will exist. A second method is the use of the ColumnHeadings property
of the query.

Thy the latter first, then the former if extreme measures are needed.
 
R

Randal

ColumnHeadings property was the answer. Thanks

[MVP] S.Clark said:
No. To work around this, you can create a semi-permanant table of which you
write the crosstab into. This guarantees that all of the expected fields
names will exist. A second method is the use of the ColumnHeadings property
of the query.

Thy the latter first, then the former if extreme measures are needed.

--
Steve Clark, Access MVP
FMS, Inc.
www.fmsinc.com/consulting

Randal said:
I have a cross tab query that provides the fields for an append query. It
works fine until there is no data to create one of the fields then the 2nd
query errors out looking for the field. Is it possible to test for this
error in the second query and have the second query supply dummy data?
For
example:
iif( error exists, 5, [Field1])
 

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