Solved

calling a sub procedure

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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