Public Function

arkres

Registered User.
Local time
Today, 11:24
Joined
Sep 26, 2001
Messages
62
Hello. I have written a public function as follows:

Public Function FullName() As String

FullName = FirstName & " " & LastName


End Function

The function is contained in a module.

When I try to call this function to use on a form, I get an error message "variable not defined"

I'm a new user and I'd appreciate any help here. Thanks a lot.

Pat
 
You have to pass the FirstName and LastName to the function as it has nothing to work with otherwise.

Public Function FullName(Fname As String, Lname As String) As String

FullName = Fname & " " & Lname

End Function

Call you function with: FullName([FirstName],[LastName]). Change FirstName and LastName to the actual names of the fields on your form.
 

Users who are viewing this thread

Back
Top Bottom