I'm a Java programmer, and I've got some (old) visual basic training, but as some of you have already found I'm having serious difficulties learning access basic. The question for today is thus:
In Java it is possible to declare a function more than once with different inputs, so that depending on what variables get passed to it a different version of the function runs. An example of this is as follows
Private Sub Display(intInput As Integer)
intValue = intInput * intInput
MsgBox intValue
End Sub
Private Sub Display(strInput As String)
MsgBox strInput
End Sub
then I can call
Display 4
and the compiler would recognise that I'm passing an integer, and run the first sub. The output would be a message box with 16 in it
Or I could call
Display "Hello"
and the output would be a message box with "Hello" in it. Is it possible to do this with VB? If not, is there a workaround that'll give the same results? I was thinking I could have one of each type of input, then each time I call it I set all passed variables to null except the one I want to work with, then have a casewhere each one <> null. This could get very messy, so I'd prefer it if I could do multiple declarations. Does anyone have any idea what I'm babbling about? If so, please help me out, or just give me the name of a good therapist.
In Java it is possible to declare a function more than once with different inputs, so that depending on what variables get passed to it a different version of the function runs. An example of this is as follows
Private Sub Display(intInput As Integer)
intValue = intInput * intInput
MsgBox intValue
End Sub
Private Sub Display(strInput As String)
MsgBox strInput
End Sub
then I can call
Display 4
and the compiler would recognise that I'm passing an integer, and run the first sub. The output would be a message box with 16 in it
Or I could call
Display "Hello"
and the output would be a message box with "Hello" in it. Is it possible to do this with VB? If not, is there a workaround that'll give the same results? I was thinking I could have one of each type of input, then each time I call it I set all passed variables to null except the one I want to work with, then have a casewhere each one <> null. This could get very messy, so I'd prefer it if I could do multiple declarations. Does anyone have any idea what I'm babbling about? If so, please help me out, or just give me the name of a good therapist.