difference between opening a query

jeremypaule

Registered User.
Local time
Today, 09:47
Joined
Aug 21, 2006
Messages
135
what's the difference between...

Dim stDocName As String

stDocName = "APPEND - DATA"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True


and

DoCmd.SetWarnings False
DoCmd.OpenQuery "ADD EVENT"
DoCmd.SetWarnings True


are their benefits to either?
 
I assume you mean the bit about using a variable for the name? Personally, I only do that if I'll be using the name in more than one place in the code, or I'll be setting it to different things depending on user selections. Otherwise, I just use the second method. Performance-wise, I'd assume the second is faster, since the first would have to resolve the variable name back to the actual name anyway.
 

Users who are viewing this thread

Back
Top Bottom