[AccessD] A2K: Get Current Sub Name

Stuart Sanders stuart at pacific.net.hk
Fri Nov 14 08:18:05 CST 2003


While I just tried this in debug mode, I got err.Source as the name of the
database (ie from database properties).  Not the name of the module.

I tested with a class module, so I'll take a look at other modules.

Stuart

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> Gustav Brock
> Sent: Friday, 14 November, 2003 4:15 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] A2K: Get Current Sub Name
>
>
> Hi Darren
>
> At least you can retrieve the name of the module ...:
>
> <code>
>
> Public Sub ModuleName()
>
>   Dim strModuleName  As String
>
>   On Error Resume Next
>   strModuleName = Null
>   strModuleName = Err.Source
>
>   MsgBox strModuleName
>
> End Sub
>
> </code>
>
> /gustav
>
>
> > Is there a way to determine the current sub name once you
> are in it then display it
> > Is there a Current Sub Property? etc
>
> > eg  (PSEUDO Code)
> > Private Sub MySub()
> > Msgbox "My Sub Name is " & Application.SubName
> > End sub
>
> > Many thanks in advance
>
> > Darren
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>




More information about the AccessD mailing list