Gustav Brock
Gustav at cactus.dk
Sun Apr 1 06:49:01 CDT 2007
Hi Shamil Thanks, that explains. I will note this, should I ever have to do some serious programming in VBA outside Access. /gustav >>> shamil at users.mns.ru 01-04-2007 12:52 >>> Hi Gustav, With Access.Application parameter passed as optional you "reserve" opportunity to easily use the same code in Access Automation scenarios. I also often (in my "previous life" when I programmed a lot on VBA) did use: Optional ByRef rdbs as DAO.Database = Nothing That "saved my life" many times when the database to work with wasn't CurrentDB. For this subject case it's not needed because this code always operates with CurrenDb... The usage of: With app Is used to not have costly Automation "round-trip" of getting reference of MS Access instance. It's not needed when Access Automation is not used. Using explicit: app.DoCmd... .. App.CurrentDb .. Is good programming style IMO - when used that way then you get automatic habit to use it simira way when programming MS Word/MS Exce/... Automation - then copy & paste code between different VBA hosts will never result in (unexpectedly) activating/running "ghost" background instances of MS Access/Word/Excel/..., which are often not easy to "catch" where they come from, to "kill" them etc... -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, April 01, 2007 2:04 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Column Positions Hi Shamil If this is in an Access environment, are there any benefits by specifying the Access Application object? Normally I don't use it - I'm mostly in Access - but maybe I should?