Brianwarnock
Retired
- Local time
- Today, 19:04
- Joined
- Jun 2, 2003
- Messages
- 12,701
Is this long ago post from SJ not really valid
SJ McAbney08-19-2003, 10:53 AM
Brian
SJ McAbney08-19-2003, 10:53 AM
Using the dot syntax (early binding) asks VBA to work out the object’s nuances at compile time meaning that the application knows exactly what is expected of objects as it has, basically, predetermined their characteristics beforehand which can dramatically increase the speed of your application.
Using the exclamation mark syntax (late binding) allows your application to compile but the application determines the objects at runtime, and the time taken to determine can increase performance time as you are essentially asking VBA to use an object but it must first decide what sort of object it is.
i.e.
Me.txtMyTextbox
This line allows VBA to know we are referring to the form and it knows the object txtMyTextbox is a textbox and thusly allows you access to its methods and properties.
Me!txtMyTextbox
This line is asking VBA to work out what sort of object txtMyTextbox and then evaluate it.
For optimising your database then you should really use early binding. The only caveat with using early binding is that it requires the reference libraries to compile. If you don’t have the references to these libraries then the application’s compilation will fail. The only time, to be honest, that you should use late binding is when a component does not support early binding.
Brian