UDF on query

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
 
O

Ofer Cohen

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
 
D

Douglas J. Steele

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
 

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