Results 1 to 5 of 5

Thread: Can I Do This?

  1. #1

    Thread Starter
    Hyperactive Member gravyboy's Avatar
    Join Date
    Jan 2000
    Location
    Where I was before . . . if you don't know then you're new!
    Posts
    334

    Can I Do This?

    If so how?/What am I doing wrong?

    VB Code:
    1. Private Sub FindOrderedVia(ByVal vintValue, ByVal vintUpper As Integer, ByRef ropt() As OptionButton)
    2.  
    3. On Error GoTo Error_FindOrderedVia
    4.  
    5. Dim intLoop As Integer
    6.  
    7.     gerrError.PushErrorStack "FindOrderedVia", Me.Name
    8.  
    9.     For intLoop = 0 To vintUpper
    10.         If intLoop = vintValue Then
    11.             ropt(intLoop) = True
    12.         Else
    13.             ropt(intLoop) = False
    14.         End If
    15.     Next intLoop
    16.    
    17.  
    18. Exit_FindOrderedVia:
    19.     gerrError.PopErrorStack
    20.     Exit Sub
    21.  
    22. Error_FindOrderedVia:
    23.     gerrError.ErrorHandler "FindOrderedVia", Me.Name, Err.Number, Err.Description
    24.     Resume Exit_FindOrderedVia
    25.  
    26. End Sub

    I get a mismatch error when I use the following to call . . .

    VB Code:
    1. Call FindOrderedVia(.Fields("PurOHOrderedVia"), UBound(optordered), optordered)
    Matt G
    VS6 Ent SP5 @ Work
    VS6 Ent SP5 & VB.Net @ Home
    [email protected]



  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    what's in (.Fields("PurOHOrderedVia")?

    i'm thinking it's the ByRef ropt() As OptionButton that's giving the error

  3. #3
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Exclamation Looks wrong...

    Private Sub FindOrderedVia(ByVal vintValue, ByVal vintUpper As Integer, ByRef ropt() As OptionButton)

    this is what u have done...
    -----------------
    when u r calling this obvously you are not passing the first value as u have declared...

    value or vintValue seems to be an integer and when you are calling it you are passing some sort of RECORDSET thing...

    ".Fields("PurOHOrderedVia")"

    -------------------------------
    Call FindOrderedVia(.Fields("PurOHOrderedVia"), UBound(optordered), optordered)

    ==============
    so, it's very obvious that there is a type mismatch mistake...

    But, can't solve it without taking a look at whole thing...

    Hope I am helpful...

    Cheers.....

  4. #4

    Thread Starter
    Hyperactive Member gravyboy's Avatar
    Join Date
    Jan 2000
    Location
    Where I was before . . . if you don't know then you're new!
    Posts
    334
    Erm nope...

    .Fields("Blah") is a value in a datatable.....

    So no mismatch there . . . .the mismatch is in passing a control array . . .
    Matt G
    VS6 Ent SP5 @ Work
    VS6 Ent SP5 & VB.Net @ Home
    [email protected]



  5. #5

    Thread Starter
    Hyperactive Member gravyboy's Avatar
    Join Date
    Jan 2000
    Location
    Where I was before . . . if you don't know then you're new!
    Posts
    334
    sorry ax . . . missed your reply, but yeah it's in that somewhere. What I originally needed to do was pass a control array into a control array parameter...

    Having said that I have worked aqround it now....

    Thanks all...
    Matt G
    VS6 Ent SP5 @ Work
    VS6 Ent SP5 & VB.Net @ Home
    [email protected]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width