Function Call ?

  • Thread starter Thread starter Scientific
  • Start date Start date
S

Scientific

Hello all,

I want a public function that I can call from any procudure. All it does is
display a message. The trouble I'm having is in the call itself. I just
want to be able to execute it when needed wherever required.

How does one call a function that passes no values?

-S
 
Just call it. In code:

Call MyFunction()

In the property sheet:

= MyFunction()
 
Arvin,

I created the following function module:

Public Function ShowMessage()
MsgBox "Duplicate entries will not be processed."
End Function

Then, I tried to use it in a sub routine as follows, but recieved an error
message that say's "Compile error: Expected variable or procedure, not module"

Private Sub UserList()
Call GetLoggedUsers()
End Sub

-S
 
Arvin,

I created the following function module:

Public Function ShowMessage()
MsgBox "Duplicate entries will not be processed."
End Function

Then, I tried to use it in a sub routine as follows, but recieved an error
message that say's "Compile error: Expected variable or procedure, not module"

Private Sub UserList()
Call GetLoggedUsers()
End Sub

-S

The function name is ShowMessage.
That's what you have to call, not GetLoggedUsers()

Private Sub UserList()
Call ShowMessage
End Sub
 
fredg,

Duh, I forgot to update the name change. Thanks fredg, it works now. And
thank you too Arvin. I love you folks :-)

-S
 
Arvin, fredg,

Just wanted you to know I'm having loads of fun with functions now because
they make more sense and are really cool. As you can see it's the middle of
the night and I'm wide awake working with Access, can't leave it alone since
you helped me out. I think the two of you helped in creating an Access
monster and I'm very grateful for it :-)

I owe you!

-S
 
Arvin,

Thanks a million for leading me in the right direction. Your guidance never
goes without great appreciation :-)

-S
 
Back
Top