Solved

calling a sub procedure

Posted on 2008-10-06
1
473 Views
Last Modified: 2013-11-27
'I would like to call this sub procedure but I am not sure if I am doing it right.
CALL SetAccountAccess(intUserID, dstAccounts)
=======================================================

'Determine if the user is an owner or officer of any of his business
        Private Sub SetAccountAccess(ByVal intUserID As Integer, ByVal dstAccounts As DataSet)
            'GetUserNameAndRole
            Dim intAccount As Integer
            blnIsOwner = False
            blnIsTaxPrep = False

            For i As Integer = 0 To dstAccounts.Tables("AccountSelections").Rows.Count - 1
                intAccount = dstAccounts.Tables("AccountSelections").Rows(i).Item("EmployerAccountNumber")

                Dim colReturn As NameValueCollection = objBusinessLayer.GetUserNameAndRole(intUserID, intAccount)


                'Put code here
                If Not blnIsOwner AndAlso colReturn("AuthorizationType") = "0" Then 'If User is owner/officer
                    blnIsOwner = True
                    'If blnIsTaxPrep Then Exit For
                End If
                If Not blnIsTaxPrep AndAlso colReturn("AuthorizationType") = "2" Then
                    blnIsTaxPrep = True
                    'If blnIsOwner Then Exit For
                End If

            Next
        End Sub
       
       
       
*******************************************************************************************************************************        
       
       
      Private Sub GetAccountSelections()

                  '**********************************************************************
                  ' If selected accounts exist, load them into the table.
                  '**********************************************************************
                  Dim dstData_AccountNumbers As DataSet
            Dim dvwData_AccountNumbersAndNames As New DataView





                  Try
                        dstData_AccountNumbers = objBusinessLayer.GetAccountSelectionsAll(Session("UserIdent"))

                        If dstData_AccountNumbers.Tables("AccountSelections").Rows.Count > 0 Then
                    dvwData_AccountNumbersAndNames = objBusinessLayer_MFCentral.GetAccountNumbersAndNames(dstData_AccountNumbers, False)



                    If dvwData_AccountNumbersAndNames.Count > 0 Then
                        LoadTable(dvwData_AccountNumbersAndNames)



'I would like to call this sub procedure
CALL SetAccountAccess(intUserID, dstAccounts)

                    Else
                        Me.tblSelectedAccounts.Visible = False
                    End If

                Else
                    Me.tblSelectedAccounts.Visible = False
                End If

            Catch objError As Exception
                Throw objError

            End Try

        End Sub    
0
Comment
Question by:WDJ98338
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 500 total points
ID: 22653257
in VB.net, you can omit the CALL keyword.

Otherwise ... I think it looks good.

Does it give you the expected results?
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question