Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[b]Passing array of user defined type to function[/b] 1

Status
Not open for further replies.

Wayfarin

Programmer
Mar 21, 2005
2
US
I am trying to pass an array of user defined types to a function. I am getting error code "byref argument type mismatch". If I change everything to an array of string type it works fine.

Declared value:
Code:
Type ClassificationArray
    Code As String
    Desc As String
End Type
Public ClassificationAry() As ClassificationArray


Calling value:
Code:
xx =  LoadClassifications(Command2(Index).Caption, ClassificationAry)

function:
Code:
Function LoadClassifications(ByRef DBClass As String, ByRef ClassAry As ClassificationArray)

any ideas?
 
In your function declaraion change
ByRef ClassAry As ClassificationArray
to
ByRef ClassAry() As ClassificationArray



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top