Solved

calling a sub procedure

Posted on 2008-10-06
1
456 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

743 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

20 Experts available now in Live!

Get 1:1 Help Now