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 / Queries / July 2006

Tip: Looking for answers? Try searching our database.

module coding in query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Russ - 21 Jun 2006 21:21 GMT
I have a query of many clients and use a code to look at fields in a child
table. Not every client in the query has a record in the child table. The
code takes 5 fields from the child table and puts them in the form of AA, BB,
CC. It does include the child fields that are false. The code is run as a
field in teh query. the problem is for those records where the client does
not have a record in the child table, i get an error. How do i fix my code so
that it will not run for those clients who do not have a record in the child
table?
i have tried something like:
if rst is emtpy then string is null  ?????

thank you for your help,
russ
Signature

Russ

Michel Walsh - 01 Jul 2006 12:19 GMT
Hi,

Empty means the variable has not been define yet.  You can use, in  VBA,
something like:

If IsNull(rst.Fields("myField")  ) Then

   ... ' myField has a null value

Else

   ... ' myField has a not null value

End if

but you can also filter the data in the query, in the first place, using
either an inner join rather than an outer join, or a where clause like:

... WHERE Not( Myfield Is Null)

Hoping it may help,
Vanderghast, Access MVP

>I have a query of many clients and use a code to look at fields in a child
> table. Not every client in the query has a record in the child table. The
[quoted text clipped - 12 lines]
> thank you for your help,
> russ
 
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.