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 / May 2008

Tip: Looking for answers? Try searching our database.

exit function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
samotek - 29 May 2008 06:24 GMT
I have a function checking two controls Saldo and Stock. Sometimes  one of
the two controls may be empty, having no figures in it.In this case I want to
give the command to exit the function.For example, when the control stock is
empty, I get the following message :
You tried to execute a query that does not include the specified expression
“stock” as part of an aggregate function
I do not want to break the function, for the function has other tasks to do,I
just want to have no messages for an error but jist skip it. How coul I do it
?
Part of my function is the following :
Dim F As Form
Set F = Forms!FBenchmark
If Nz(F!Saldo) <> Nz(F!stock) Then
Alex Dybenko - 29 May 2008 08:06 GMT
Hi,
you can check for empty as IsNull(F!stock) or Len(F!stock & "")=0

Set F = Forms!FBenchmark
if Len(F!stock & "") >0 then
   If Nz(F!Saldo) <> Nz(F!stock) Then
...

Signature

Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

>I have a function checking two controls Saldo and Stock. Sometimes  one of
> the two controls may be empty, having no figures in it.In this case I want
[quoted text clipped - 14 lines]
> Set F = Forms!FBenchmark
> If Nz(F!Saldo) <> Nz(F!stock) Then
 
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.