Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling the same function name from two different modules

Status
Not open for further replies.

stacyandrews

Programmer
Aug 30, 2000
2
IN
I have two functions with the same name in two separate modules, each declared public. I do not know how to reference either one in a sql statement. My statement is:
SELECT OW_Well_Master.WELL_UWI, testme([well_uwi]) AS Example_of_Call_Routine
FROM OW_Well_Master;

testme() is the function i am trying to call. the modules are called MOD1 and MOD2.

Any help would be greatly appreaciated.

Stacy Andrews
 
You should NOT have more than one function with the same name! Bad practice. I am surprised that you are not getting an "Ambiguous Name Detected: testme" error. Go to the design of any module, and select from the menu bar, Debug | Compile all modules. If you have 2 public functions with the same name, you should get an error.

The syntax in your SQL looks correct. Why do you need 2 functions with the same name?

Try renaming one of the functions, and see if the query works.
 
Thanks for your help. I do know that it is bad practice, and yes I did get an ambiguous statement error, but what I was really trying to get to the bottom of was another problem...
My function call does not work outside Access. The query works fine when used in an access query, but I wanted to embed the query into a program I was writing in VB. Using the above SQL statement, I get the following error:
Undefined function 'testme' in expression

I am using the Jet OLEDB driver to connect to the DB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top