celerno
celerno

Reputation: 1387

How to find a Label with Caption = "XYZ" in MS Access 2002?

In MS ACCESS, I can't find an approach to search over the Objects. I want to write a script or find a plug in for MSAccess 2002 to find objects by his property values

I'm doing maintenance to a huge app in ACCESS and I'm dealing a lot to find the right elements through the application.

In Visual Fox PRO, you could open a Window Form by using a USE statement, like any regular table and make search queries.

Thanks in advance fellas.

Upvotes: 0

Views: 291

Answers (2)

celerno
celerno

Reputation: 1387

I've found several excellent "Find" add-ins for Access.

http://www.skrol29.com/us/vtools.php

And Andrew recommend this ones: http://www.rickworld.com/products.html

Upvotes: 0

Tom Collins
Tom Collins

Reputation: 4069

You want something like this.

Function CaptionCheck(Capt As String) As String
   Dim Ctl As Control
   Dim Frm As Form
   Set Frm = Forms("form1")
   For Each Ctl In Frm.Controls
      If Ctl.ControlType = 100 Then  'label
         If Ctl.Caption = Capt Then
            CaptionCheck = Ctl.Name
         End If
      End If
   Next
End Function

Upvotes: 2

Related Questions