UDF on query

  • Thread starter Thread starter yanto
  • Start date Start date
Y

yanto

How to create any user define function that can be called from query
like Ms Access standart function? If possible give one simple
function.
TIA
Yanto
 
If you have a function (has to be in a module) that get a parameter and
return a value, you can call this function from the query just as you use a
build in function in Access

e.g
Function FunctionName(MyNumber as Double)
FunctionName = MyNumber * 100
End Function

Select TableNAme.*, FunctionName([FieldNameToPass]) As NewFieldName From
TableName
 
Note that you will not be able to use the query if you're attempting to run
it from outside of Access (on a web page or from a VB program, for
instance).

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ofer Cohen said:
If you have a function (has to be in a module) that get a parameter and
return a value, you can call this function from the query just as you use
a
build in function in Access

e.g
Function FunctionName(MyNumber as Double)
FunctionName = MyNumber * 100
End Function

Select TableNAme.*, FunctionName([FieldNameToPass]) As NewFieldName From
TableName

--
Good Luck
BS"D


yanto said:
How to create any user define function that can be called from query
like Ms Access standart function? If possible give one simple
function.
TIA
Yanto
 
Back
Top