|
-
Oct 18th, 2009, 12:56 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Me!Text1 = Me.Text1 ???
hi, I found for the 1st time, a source-code where a guy uses "!" instead of "." to access the controls of a Form ! 
eg:
Code:
Msgbox Form1.Text1.Text
is the same as :
Code:
Msgbox Form1!Text1.text
(After making my tests, I noted that: use the "!" will point only to the controls, and not work with properties! (Me!Caption will not work))
But, i need more informations about that, is ther something else i dont know ?
 DoEvents
-
Oct 18th, 2009, 01:22 AM
#2
Re: Me!Text1 = Me.Text1 ???
yes u r right its working only for controls, thanks for ur info...
-
Oct 18th, 2009, 04:32 AM
#3
Re: Me!Text1 = Me.Text1 ???
Office VBA also uses this optional notation but for objects
Ex...
Access:
Form1!TextBox1.Text
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 18th, 2009, 05:50 AM
#4
Re: Me!Text1 = Me.Text1 ???
The default property of a Form is a hidden property named [_Default] which normally holds a reference to the Form's Controls collection.
The "bang" (!) syntax is usable for access to a collection object's Item property. Using various levels of default properties, these all produce the same result when used in Form1:
Code:
MsgBox Form1.[_Default].Item("Command1").Name
MsgBox Form1!Command1.Name
MsgBox Form1.Controls("Command1").Name
MsgBox Form1.Controls.Item("Command1").Name
MsgBox Form1.Controls!Command1.Name
MsgBox Command1.Name
-
Oct 18th, 2009, 06:52 AM
#5
Thread Starter
Addicted Member
Re: Me!Text1 = Me.Text1 ???
Woow thanks dilettante
 DoEvents
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|