Return Multi-Values from Module

Sorrells

Registered User.
Local time
Today, 21:12
Joined
Jan 13, 2001
Messages
258
Hello,

I want to pass 2 variables from two different forms to a common routine. The routine needs to return 4 values to the calling statement.

I am unsure what structures can handle this. I would appreciate any advice.
 
Well you can call a routine using 2 parameters. As to returning 4, you can either set field values in a form (could be invisible), you can set variables, or you can define a user type and return that user type which contains multi value.
May even be more but I usually use the first 2.
 
Fofa,

Thanks for or response. I finally worked with crating a function and it worked just fine! I was running on a paradigm that a function could return only one value. The call and function statements below allow for changes in all 4 variables passed.

I called the function from 2 forms but now can keep the common code in a single location for future maintenance. Four variables are passed to the function as noted in the call below.

Call Get_Task_Sched(Schedule_Opt, Default_Freq, Default_Week, Default_Day)

The function is located in it’s own module at this time, Task_Freq_ID. Within the module, it is identified as follows:

Public Function Get_Task_Sched(Schedule_Opt As Integer, Default_Freq As Integer, _
Default_Week As Integer, Default_Day As Integer)

All the values made in the call to the function might be changed when the function has completed its work for the form's to take advantage of.

I appreciate your help!

Regards,
 

Users who are viewing this thread

Back
Top Bottom