Using a function from within a query

  • Thread starter Thread starter Irishmaninusa
  • Start date Start date
I

Irishmaninusa

Hi Everyone,


I think this is possible.....just haven't found the link where I saw
it.....but I have vba function that I wrote....and I would like to use it
from Access.....is this possible to do? and if so how do you do it.

--
J.Daly
structure:interactive
Ph: 616-364-7423
Fx: 616-364-6941
http://www.structureinteractive.com
 
If this function is in a module in Access, you can use it like you would use
any built in functions.

--
Duane Hookom
MS Access MVP


"Irishmaninusa"
 
that is where I have it


and this is the statement I use

SELECT * FROM tblA WHERE ArcCos(fieldname) > 0
 
What happens when you try this? Do you get an error message? Is fieldname a
field from your table?

--
Duane Hookom
MS Access MVP


"Irishmaninusa"
 
Irishmaninusa said:
Hi Everyone,


I think this is possible.....just haven't found the link where I saw
it.....but I have vba function that I wrote....and I would like to use it
from Access.....is this possible to do? and if so how do you do it.
What is the name of your VBA function? Where did you place it?

Let's assume the name of the function is
GetNumber. Something like this:

Function GetNumber([NumberIn)
' Do something here
GetNumber = SomeValue
End Function

Place it in a Module.

Then, in a query, write:
Exp:GetNumber([PassThisFieldToFunction])

Or in a control's control source:
= GetNumber([PassThisFieldToFunction])
 
Back
Top