Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 480
  • Last Modified:

calling a sub procedure

'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
WDJ98338
Asked:
WDJ98338
1 Solution
 
Daniel WilsonCommented:
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now