Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exit function

Status
Not open for further replies.

samotek

Technical User
Joined
May 9, 2005
Messages
197
Location
BG
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
 
Is the line above giving the problem?


As an aside, it is generally a good idea to rename controls so they do not have the same name as the data they contain. For example txtSaldo, cboStock and so on (
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top