Export query if not null

J

Jason

I am using a Transfer text macro to export the results of
a bunch of queries to text files.

However, I dont want it to create the file if the query
returns no results.

What do I have to put in the condition box of that line
for this to happen?

I tried:

Is not null ([Query Name]![Field Name])

but that didn't work.....
 
K

Ken Snell

DCount("*", "Query Name") > 0

With above condition expression, the macro action will run only if there is
at least one record in the query.
 
J

Jason

Thank you!!!
-----Original Message-----
DCount("*", "Query Name") > 0

With above condition expression, the macro action will run only if there is
at least one record in the query.

--
Ken Snell
<MS ACCESS MVP>

Jason said:
I am using a Transfer text macro to export the results of
a bunch of queries to text files.

However, I dont want it to create the file if the query
returns no results.

What do I have to put in the condition box of that line
for this to happen?

I tried:

Is not null ([Query Name]![Field Name])

but that didn't work.....


.
 
K

Ken Snell

You're welcome.

Jason said:
Thank you!!!
-----Original Message-----
DCount("*", "Query Name") > 0

With above condition expression, the macro action will run only if there is
at least one record in the query.

--
Ken Snell
<MS ACCESS MVP>

Jason said:
I am using a Transfer text macro to export the results of
a bunch of queries to text files.

However, I dont want it to create the file if the query
returns no results.

What do I have to put in the condition box of that line
for this to happen?

I tried:

Is not null ([Query Name]![Field Name])

but that didn't work.....


.
 

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