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 / January 2005

Tip: Looking for answers? Try searching our database.

Using variable names for controls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
siddahuja - 06 Jan 2005 18:13 GMT
dim test as string
test="control1"

now, control1 is a textbox

i wanna use the name of the variable i.e. test to get the value of the textbox

i.e. msgbox(test.text)

can any one tell me how to do it?
Douglas J. Steele - 06 Jan 2005 18:19 GMT
MsgBox Me.Controls(test)

Signature

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

> dim test as string
> test="control1"
[quoted text clipped - 7 lines]
>
> can any one tell me how to do it?
Rick Brandt - 06 Jan 2005 18:19 GMT
> dim test as string
> test="control1"
[quoted text clipped - 7 lines]
>
> can any one tell me how to do it?

MsgBox Me.Controls(test)

You don't want to use the Text property except in special circumstances as
that is the changed (but not yet updated) entry in the control with focus.
The Value property is the default and is what you would normally use.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

 
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.