N
Nick via AccessMonster.com
Hello,
I was wondering if someone could help or point me in the right direction; I
searched but am not even sure of what search terms apply.
I had several string variables declared like this:
Dim strAlreadyAdded, strErrorMessage, strCannotAdd as String
I then tried to pass them to a Sub defined as:
Public Sub Validate_MDI(ByRef strCannotAdd As String, ByRef
strErrorMessage As String, ByRef strAlreadyAdded As String, ByRef Data_Error
As Boolean)
I compiled and received a message saying strErrorMessage (and later,
strAlreadyAdded) had a ByRef argument mismatch. I reorganized by declare
statement to only have one variable per line, and I had no problems.
My question is: When variables are declared in a line like in the first
statement, does VBA carry through the "as String" to all of them? I thought
it did at first, but not I'm not so sure... I use this type of declaration
structure when declaring recordsets, and have never had a problem. I want to
be sure I force declaration, I don't want to leave it up to Access to
"assume" what variable type I want, if that is what it's doing currently.
-Nick
I was wondering if someone could help or point me in the right direction; I
searched but am not even sure of what search terms apply.
I had several string variables declared like this:
Dim strAlreadyAdded, strErrorMessage, strCannotAdd as String
I then tried to pass them to a Sub defined as:
Public Sub Validate_MDI(ByRef strCannotAdd As String, ByRef
strErrorMessage As String, ByRef strAlreadyAdded As String, ByRef Data_Error
As Boolean)
I compiled and received a message saying strErrorMessage (and later,
strAlreadyAdded) had a ByRef argument mismatch. I reorganized by declare
statement to only have one variable per line, and I had no problems.
My question is: When variables are declared in a line like in the first
statement, does VBA carry through the "as String" to all of them? I thought
it did at first, but not I'm not so sure... I use this type of declaration
structure when declaring recordsets, and have never had a problem. I want to
be sure I force declaration, I don't want to leave it up to Access to
"assume" what variable type I want, if that is what it's doing currently.
-Nick