Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / March 2004

Tip: Looking for answers? Try searching our database.

'Name' problem.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom - 24 Mar 2004 14:36 GMT
When I try to run my macro, I get an error message:

"Microsoft Access can't find the name 'cdeLinkDB2Tables'
you entered in the expression."

I'm using Access 2000 with DB2 on an AS/400 on the
backend.  The code DOES work, in debug mode.  Here's my
setup:

table - tblODBCTables - db, library, table, field names
to which to link

macro - mcrLinkDB2Tables - RunCode - cdeLinkDB2Tables -

module -
 mdl_MainProcedure -
   Public Function cdeLinkDB2Tables
   Public Sub cdeDeleteODBCTableNames

cdeLinkDB2Tables - code was debugged when this 'function'
was temporaarily made a 'sub'.  All the current ODBC
table links are deleted and recreated per the entries in
the table tblODBCTables.

I came across a note about the module name not being the
same as the macro name, or some such (hence the 'cde'
prefix on the VBA code).  But I still get the error.  
Anyone have any ideas?  Can anyone se what it is that I'm
[still] missing?

Thanks a lot, in advance,

Tom
Bryan Reich [MSFT] - 30 Mar 2004 00:07 GMT
Tom,
It looks like from your description the problem is that you are defining a
sub like a function.
Subs may or may not take parameters and have no return type. Functions must
have return types.
So functions are defined as follows:

   public function MyFunction( My Args If Any ) AS MyReturnType
       ...
       MyFunction = some value of type MyReturnType
       ...
   end function

Subs are defined as:

   public sub MySub( My Args If Any )
   end sub

If your code routine doesn't need a return value, then define it as a sub.
If it does need a return value, then you will have to set it up with the
retrurn value as diagramed above.
Signature

Bryan Reich
Microsoft Office
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> When I try to run my macro, I get an error message:
>
[quoted text clipped - 29 lines]
>
> Tom
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.