Solved

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

Posted on 2012-03-18
3
346 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 45

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 45

Expert Comment

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

759 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

19 Experts available now in Live!

Get 1:1 Help Now