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 / Modules / DAO / VBA / June 2005

Tip: Looking for answers? Try searching our database.

read index value of a control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Italian Pete - 27 Jun 2005 13:35 GMT
How do you read an index value of a control knowing the control's name?

Thanks

Pete
Alex Dybenko - 27 Jun 2005 17:14 GMT
Hmm, what index you mean? tab index or something else?

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

> How do you read an index value of a control knowing the control's name?
>
> Thanks
>
> Pete
Italian Pete - 28 Jun 2005 09:49 GMT
Alex,
I mean the index  given to each control on a form, for example:

Me.Controls(5)

where the index 5 might be the index value of a text box "txtInput".

From the index, I can find the name of a control (Me.Controls(0).Name) but
how do I do it the other way round?

Many thanks

> Hmm, what index you mean? tab index or something else?
>
[quoted text clipped - 3 lines]
> >
> > Pete
David C. Holley - 28 Jun 2005 17:33 GMT
Try Me.Controls("controlName").index

> Alex,
> I mean the index  given to each control on a form, for example:
[quoted text clipped - 15 lines]
>>>
>>>Pete
Bas Cost Budde - 28 Jun 2005 19:54 GMT
Interesting! Why?

The plain search technique comes to mind (air code):

function getControlIndex(cName as string)as long
dim i as long
for i=0 to controls.count
    if controls(i).name=cname then
        getcontrolindex=i
        exit for
    endif
next
end function

> Alex,
> I mean the index  given to each control on a form, for example:
[quoted text clipped - 15 lines]
>>>
>>>Pete

Signature

Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

 
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.