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 / August 2006

Tip: Looking for answers? Try searching our database.

#Error in custom function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kirk P. - 14 Aug 2006 18:00 GMT
I've got this function that returns good results except for some records
return #Error.  This #Error is expected, and I'm trying to trap it and report
the record as "9:  Function Group Not Defined".  What am I doing wrong?

If [FuncGroup] = "Operations" Then
       RowDesig2 = "3:  DIRECT OPS EXPENSE"
   
ElseIf [FuncGroup] = "Products" Then
       RowDesig2 = "5:  INDIRECT PRODUCT EXPENSE"
       
ElseIf [FuncGroup] <> "Operations" And [FuncGroup] <> "Products" Then
       RowDesig2 = "7: OTHER SGA-SHARED SERVICES"
       
ElseIf RowDesig2 = "#Error" Then
       RowDesig2 = "9:  FUNC GROUP NOT DEFINED"
       
Else
   RowDesig2 = "9: ERROR"
       
End If
jmonty - 14 Aug 2006 20:05 GMT
Use a Select...Case statement something like this:

Select Case [FuncGroup]
   Case "Operations"
       RowDesig2 = "3:  DIRECT OPS EXPENSE"
   Case "Products"
       RowDesig2 = "5:  INDIRECT PRODUCT EXPENSE"
   Case "#Error"
       RowDesig2 = "9:  FUNC GROUP NOT DEFINED"
   Case Else
       RowDesig2 = "9: ERROR"
End Select

jmonty

> I've got this function that returns good results except for some records
> return #Error.  This #Error is expected, and I'm trying to trap it and report
[quoted text clipped - 16 lines]
>        
> End If
 
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.