Bypassing Shift Key

G

Guest

Hello,
I'm using a function to bypass the use of ShiftKey.
Iwas intrigued by one thing... the function start as:

Public Function ChangePropertyDdl(stPropName As String, _
PropType As DAO.DataTypeEnum, vPropVal As Variant) _
As Boolean

and to call it and have it runa I had to add those lines to the OnLoad event
for one form:
Private Sub Form_Load()
ChangePropertyDdl "AllowbyPassKey", dbBoolean, False
End Sub

It works perfectly but...I was wondering, why is this function called
without any preceding "="?
I will assume something like:
something here=ChangePropertyDdl ("AllowbyPassKey", dbBoolean, False)

But this wont work. Everybook says functions are for returning a value. But
a valure is to be assigned to something (ie a variable...). Why that function
works only if called in that way?

I'm happy it works! Really!! But just would love to better understand...

Thanks,
Rocco
 
D

Douglas J. Steele

While you're right that functions are intended to return values, sometimes
you don't care what that value is.

In that case, instead of using

x = FunctionName(a, b)

you can use either

FunctionName a, b

or

Call FunctionName(a, b)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top