Using a function from within a query

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
 
D

Duane Hookom

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"
 
I

Irishmaninusa

that is where I have it


and this is the statement I use

SELECT * FROM tblA WHERE ArcCos(fieldname) > 0
 
D

Duane Hookom

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"
 
F

fredg

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])
 

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