Export query if not null

  • Thread starter Thread starter Jason
  • Start date Start date
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.....
 
DCount("*", "Query Name") > 0

With above condition expression, the macro action will run only if there is
at least one record in the query.
 
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.....


.
 
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.....


.
 
Back
Top