Bypassing Shift Key

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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)
 
Back
Top