I am working with a procedure and a module. In the procedure, a string variable (selectStatement) is created and assigned the word "Password". I then use that variable at the module level to update that variable with the Select statement text in the Case statement. It works until I return to the calling procedure where the variable selectStatement is the word "Password" again.
Below is the code. Can you tell me what I am doing wrong? Thank you
Procedure code:
Dim selectStatement as string = "Password"
'call the GetSelectStatement module and get selectStatement string value
GetSelectStatement(selectStatement)
Module level:
Module SelectTheStatement
Public Class GetStatements
End Class
Friend Function GetSelectStatement(ByVal selectStatement As String)
Select Case selectStatement
Case "Password"
selectStatement = "Select * from TblPasswords"
End Select
End Function
End Module
Below is the code. Can you tell me what I am doing wrong? Thank you
Procedure code:
Dim selectStatement as string = "Password"
'call the GetSelectStatement module and get selectStatement string value
GetSelectStatement(selectStatement)
Module level:
Module SelectTheStatement
Public Class GetStatements
End Class
Friend Function GetSelectStatement(ByVal selectStatement As String)
Select Case selectStatement
Case "Password"
selectStatement = "Select * from TblPasswords"
End Select
End Function
End Module