Solved

calling a sub procedure

Posted on 2008-10-06
1
457 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
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…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now