Return Value

martijn

Registered User.
Local time
Today, 18:59
Joined
May 13, 2002
Messages
11
I want to make a function that gives a return value, but I don't know how to build one. Could someone help me?

Thanx and Greetz
 
Not sure of what you want. If you want to carry out calculations on a field then:

Function MyStuff(TestData as ....)
''Carry out calculations then

TestData = Result of Calculations
End Function

What this does is the data being calculated is being passed to the function as variable TestData. When the function sees TestData = x it then returns x back to where it came from.

HTH
 
It's not what I mean.

In Delphi or C++ this is the body of the return function:

Funtion GiveFilename()
Return Filenaam
End Funtion

What the function has to do is return a private variable from a module class
 
The syntax in VBA is:

Funtion GiveFilename() as String
GiveFilename = Filenaam
End Funtion

It is always best to assign specific data types rather than using variants so I added the "as String". Then to set the value, you just use an equate statement in the form:

FunctionName = something
 
Thanx, that's what I needed!
=
wink.gif
 

Users who are viewing this thread

Back
Top Bottom