using vba custom function in query expression

schniggeldorf

Registered User.
Local time
Today, 08:01
Joined
Jan 7, 2013
Messages
22
Hello:

I hope somebody can help with this, because it seems so simple, but still won't work.

I have a Module containing the following:
<code>
Public Const NLetteredConst =2

Public Function NLettered() as integer
NLettered=NLetteredConst
End Function
<code>

In a query, I attempted to use the value of NLettered as an expression:

Test: NLettered()


but when I do so, I get "Unknown Jet Error" and the help screen references Error 3072.

Has anybody seen this before? Any ideas?

Thank you for your help.
 
By me it works ok, try to run the following query, (put the line in a new query)
select NLettered() as test;
 
Just checking you have not named the Function and the Module the same have you? If so change the Module name..
 

Users who are viewing this thread

Back
Top Bottom