Me![anything] or Me.anything, what's the diference

chile19

Registered User.
Local time
Yesterday, 22:45
Joined
Dec 27, 2004
Messages
14
can any one tell me what's the diference beteween

Me![ControlSubInforme].Visible = Me![ControlSubInforme].Report.HasData

and

Me.ControlSubInforme.Visible = Me.ControlSubInforme..Report.HasData

for example.


thanks
 
Using ! is referred to as late binding while the dot is called early binding.

When you use the dot you get the use of IntelliSense (drop down methods and properties) and any errors you create will be detected as you try to run the code.

When you use the ! then you don't get the IntelliSense benefit and any typing errors you make won't be detected until the code tries to run on that specific line.

Early binding runs a bit faster than late binding as, with the former, you have explicitly stated what you are referring to by navigating down the Object Model while, with the ! the code comes to the property and has to cycle through every potential property/method of whatever object you are referring to until it finds a match. If it finds no match the error is created - this error would have been detected early by using early binding.

You should only use the ! when you can't possibly use early binding - an example being referrng to a textbox in a query:

[Forms]![frmExample]![txtExample]
 

Users who are viewing this thread

Back
Top Bottom