Can I retrieve the value of user-defined type in a query

bremersj

New member
Local time
Today, 07:46
Joined
Aug 7, 2013
Messages
4
Is there a way to retrieve the value of a user-defined type in a query?

Here's the type:
Code:
Public Type ClassRank
    Rank As Integer
    ClassCount As Integer
End Type

I have a function with the following excerpt:
Code:
Function GetRank(strDOD) as ClassRank
...
GetRank.Rank = intRank
GetRank.ClassCount = intCount
...
End Function

In my query I expected to be able to put the following:

Code:
GetRank(strDOD).Rank & " " & GetRank(strDOD).ClassCount

However, Access didn't like the period in .Rank or .ClassCount.

Any easy solutions or should I just write two different function to get 'rank' and 'classcount'?

Thanks for your help!

--Steve
 
Adjust your code slightly.
Code:
dim udtResult as ClassRank

udtResult = GetRank(strDOD)

udtResult.Rank & " " & udtResult.ClassCount

HTH:D
 
Ahh...perfect. Thank you!
 

Users who are viewing this thread

Back
Top Bottom