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 / October 2007

Tip: Looking for answers? Try searching our database.

Using a variable to refer to a control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wavequation - 01 Oct 2007 19:21 GMT
Is it possible to use a string variable to refer to a control?
Douglas J. Steele - 01 Oct 2007 19:27 GMT
Dim strControlName As String

 strControlName = "txtField1"
 MsgBox "The content of " & strControlName & _
   " is " & Me.Controls(strControlName)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Is it possible to use a string variable to refer to a control?
BrerGoose - 01 Oct 2007 20:16 GMT
Even shorter....Me(strControlName)

BrerGoose
Pieter Wijnen - 02 Oct 2007 02:52 GMT
and even more correct: Me.Controls(strControlName).Value

Pieter

> Dim strControlName As String
>
[quoted text clipped - 3 lines]
>
>> Is it possible to use a string variable to refer to a control?
 
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.