[AccessD] Current Control Name

dmcafee at pacbell.net dmcafee at pacbell.net
Fri May 6 12:43:44 CDT 2005


After rereading that several times, I see Lambert got the point. In addition
to what he replied (which does do what you asked), you could use the
following if you only want to capture the number (not the "_IF")


right(LEFT(Control.Name, LEN(Control.Name)-3), LEN(LEFT(Control.Name,
LEN(Control.Name)-3))-3)

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Heenan,
Lambert
Sent: Friday, May 06, 2005 10:20 AM
To: 'Access Developers discussion and problem solving'; 'Nicholson,
Karen'
Subject: RE: [AccessD] Current Control Name


=Mid(Control.Name,4)



> -----Original Message-----
> From:	accessd-bounces at databaseadvisors.com
> [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of Nicholson, Karen
> Sent:	Friday, May 06, 2005 12:43 PM
> To:	Access Developers discussion and problem solving
> Subject:	RE: [AccessD] Current Control Name
>
> In this example, Ctl1_IF ,I would want to suck out 1_IF which is the
> name of the control.
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
> Sent: Friday, May 06, 2005 11:33 AM
> To: 'Access Developers discussion and problem solving'
> Subject: RE: [AccessD] Current Control Name
>
> Karen;
>
> Are you trying to glean the control's text or the control's name? I
> don't understand what you mean by "pulling the text to the right of the
> Ctl" -- to you mean
>
> controlname & controltext
>
> Have you tried ctl.Name where ctl is an Access Control object? Not sure
> that's what you're after though.
>
> Susan H.
>
> I have several controls on a form.  Each is named as Ctl1_IF.  I want to
> be able to capture the name of each control, pulling the text to the
> right of the Ctl and use it in calculations.  I am tired of typing it
> over and over... and it is Friday so where is all the humor at?  Here is
> an example of one of the pieces of code
>
> Private Sub Ctl1_IF_AfterUpdate()
>
>         If (me.[1-IF] > 99) Then
> 	me.result = "FAIL"
>         End If
>
>
> Question is, sucking out the name of the current control...
>
> Thanks.
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
--
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