Solved

How to run a self-write function in an access query?

Posted on 2012-03-18
3
378 Views
Last Modified: 2012-03-18
Dear all experts,

I write a function in access and place it in module, let say:

fx_ReturnNumber (strTemp as string) as string
  Dim strTemp2 as string

  strTemp2 = strTemp & " -  Hello World"
 
  fx_ReturnNumber = strTemp2
End Function

If I can bind about function to my query, the result of the query will look like that

ABC - Hello World
CDE - Hello World
EEF - Hello World
...
..
..
..
XZX - Hello World

I've some query and want to use this function but I cannot include it, does anyone tell me how to accomplish this?  Thanks in advance.
0
Comment
Question by:towo2002
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
Martin Liss earned 300 total points
ID: 37735037
I'm not sure what you mean when you say "I've some query and want to use this function but I cannot include it". Do you mean that you get an error? To use a custom function in a query you do it this way:

CustomFunctionName([fieldname])
0
 
LVL 1

Author Comment

by:towo2002
ID: 37735050
Sorry, I go it.  Thanks.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 37735055
Glad I could help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question