Global User Defined Type

youknow

New member
Local time
Today, 08:40
Joined
Jun 19, 2012
Messages
4
Is it possible to have a 'Global' User Defined Type?

I have module coded that retrieves all aspects (fields) of a project from a table of projects based on user input. I am using a User Defined Type to assign all of the attributes retrieved.

For example: A user selects a project from a combo box populated with projects. The code then calls a function GetProjectInfo and the function retrieves all of the info about the project:
projectinfo.title
projectinfo.site
projectinfo.projectmanager
projectinfo.projectengineer
projectinfo.activestatus

I want to use these values every in my app, based on what project the user has selected (instead of requerying all of these everytime they need to be used.

The value retrievals works great, but, I can't use the User Defined Type anywhere else or with any other module, form, report, etc. They only work in the function that retrieves them.

What am I missing? Any ideas? Can I pass the UDT back to the calling function?
 
Easy One!

In your module, under the Option Compare Database line simply put

Option Compare Database
Public PSite As Integer
Public PTitle As Boolean

etc

Just make sure you don't uese any keywords like Date
 
i don't quite follow your syntax

are you saying you have defined a public type

type Tprojectinfo
title as string
site as string
end type

and them dimmed it
dim projectinfo as Tprojectinfo
(or)
public projectinfo as Tprojectinfo

so now you can use
projectinfo.title
projectinfo.site


and now you want to do something else?
 

Users who are viewing this thread

Back
Top Bottom