MajP posted a link to advise someone to properly format their code and declare vars.
I was perusing the link, and found this..
IE don't declare a var as
How true is this? or should I say how bad is using this syntax?
I especially use this when I am attaching a controller type class to a form or a global helper object such as audit trail....
Surely I don't need to change that to...
Do I?
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
I was perusing the link, and found this..
Don't Use Auto-Instancing Object Variables
IE don't declare a var as
Code:
Dim myVar as New clsMyClass
How true is this? or should I say how bad is using this syntax?
I especially use this when I am attaching a controller type class to a form or a global helper object such as audit trail....
Code:
Option Compare Database
Option Explicit
Private oAudit As New clsAuditTrail
Private Sub Form_Current()
Call oAudit.SetFieldValues(Me)
End Sub
Surely I don't need to change that to...
Code:
Option Compare Database
Option Explicit
Private oAudit As clsAuditTrail
Private Sub Form_Open(Cancel As Integer)
Set oAudit = New clsAuditTrail
End Sub
Private Sub Form_Current()
Call oAudit.SetFieldValues(Me)
End Sub
Do I?
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music