Test If Query Output is Null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've setup VB script to export query results to a file. If the query output
is null or has no records, I would like to provide the user with a message
rather than export an empty file.

Also, I would like to detect if there are empty values for a particular
field in the query and alert the user of this. Is there a way to do this?

Any help is appreciated.
 
Hi,
you can use for example DCount() function, to check if your query return any
record:

if DCount("*","MyQyery")=0 then
MsgBox "No Records!"
else
'export
end if
 
It works. Thanks

Alex Dybenko said:
Hi,
you can use for example DCount() function, to check if your query return any
record:

if DCount("*","MyQyery")=0 then
MsgBox "No Records!"
else
'export
end if
 
Back
Top