Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Test If Query Output is Null

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JR_06062005 - 20 Jan 2006 16:08 GMT
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.
Alex Dybenko - 20 Jan 2006 17:29 GMT
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

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> I've setup VB script to export query results to a file.  If the query
> output
[quoted text clipped - 5 lines]
>
> Any help is appreciated.
JR_06062005 - 20 Jan 2006 17:43 GMT
It works.  Thanks

> Hi,
> you can use for example DCount() function, to check if your query return any
[quoted text clipped - 15 lines]
> >
> > Any help is appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.