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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function Name Not Found 1

Status
Not open for further replies.

DugyWugy

Technical User
Oct 13, 2000
25
CA
Hello List,

I've done some searching and can't seem to find the solution to my problem. I have created a Public Function that will successfully execute in the VBA window. I created a macro and have the RunCode command calling my function. It runs perfectly on my machine. However, I installed the database on a client's machine and I get the error when running the macro that the Function Name can't be found. I checked references and everything seems to be fine. We are both running XP Pro and Access 2003. I did see some threads referring to a similar issue with Access 97 - but none of the threads seemed to have a solution.

Any insight would be appreciated!
Thanks,
Doug
 
Where is the function stored? in a Dll? In a module?

Is the function (VBA?) present at the client's machine?

EasyIT

"Do you think that’s air you're breathing?
 
Hi EasyIT,

The function is stored in a module. The VBA module is on the client's machine. Everything is within the same database (forms, modules, macros, queries). There is one table that is linked to another database. The strange thing is that it works on my machine and does not on the client's.

Thanks,
Doug
 
Yes. Both of us are running Office 2003 with XP Professional (Service packs are all up-to-date on both).

Thanks,
Doug
 
Did you try debugging the code and see at which it stops. If you don't mind is it possible to see the code?
 
Here is the Function:

'******************************
Public Function CheckForData()
Dim OneCallData As Object
Dim stDocName As String
Dim Name As String

stDocName = "Print_Locates"

Set OneCallData = Application.CurrentDb.OpenRecordset("SELECT * FROM tblOneCall WHERE JobStatus = 'Incomplete' Or JobStatus Is Null AND Printed Is Null")
If OneCallData.RecordCount = 0 Then
DoCmd.Quit
Else
DoCmd.RunMacro stDocName
End If

End Function
'******************************


The Macro is called "CheckForNewData"
The Action for the macro is RunCode
The Function Name is CheckForData()

Thanks for your help.
 
I haven't tried debugging the code because it runs fine if executed within the vba window on both machines. The issue is trying to run it from the macro. When I run the macro is says that it can't find the function on the client's machine; but, runs fine on mine (within the vba window and by the macro).

Thanks,
Doug

 
...can you create a new macro (on the client machine) and choose the function? if so, execute the macro but first set a break on the function header...

EasyIT

"Do you think that’s air you're breathing?
 
Hi EasyIT,

Sorry for all the confusion. I found the source of my problem. Rookie mistake (I had the module name and function name the same). I changed the function name and the macro executed properly.

Sorry for wasting your time.
Thanks again,
Doug
 
Nice job Doug

Thats why Debuging is the bigest headache even more then programing itself

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top