Solved

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

Posted on 2012-03-18
3
355 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 46

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 46

Expert Comment

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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now