Article View: comp.databases.ms-access
Article #26Re: quick question on Database Variables
From: Tom van Stiphout
Date: Mon, 14 Sep 1998 00:00
Date: Mon, 14 Sep 1998 00:00
66 lines
2839 bytes
2839 bytes
On Sun, 13 Sep 1998 16:23:13 -0400, "Anthony" <anv@prodigy.net> wrote: To start your application, don't open the main form. Instead have an AutoExec macro which calls a public function, e.g. InitApplication. In this function you perform all initializations, and then you DoCmd.Openform your main form. The changing size of your database is not unusual. Working in design mode will create temporary objects which, just like deleted records, do not get deleted until you compact your database. Compact frequently. -Tom. >Hello all, >I hope someone can answer my question regarding Database variables - I would >appreciate it! > >I created an Access application with one Main Form and several Subforms >within it. >There are several modules with code. > >In a General Declarations section of one of my Modules, I have the following >code: > >Public dbsName as database >Public wrkName as Workspace > >In the On_Load event of the Main Form (i.e. when the application "starts"), >I have the following code: > > Set dbsName = CurrentDb > Set wrkName = DBEngine.Workspaces(0) > >There are hundreds of instances when this Database Variable - dbsName - is >invoked. I thought it would be best to Set it when the Main Form opens. > >Unfortunately, though, I am having two problems: >1. Whenever I leave the Main Form (a Massage Box pops pop, thus Focus being >transferred from MainForm to something else..) .. whenever this happens and >the program tries to execute a line with the database variable in it, it >creates an 'Object Not Defined" error. > >So, my question is: WHEN (and how often), should the database variable be >Set and/or defined ?? > > >2. My other simple question is this: >My database is EXPLODING in size, despite the fact that I am neither adding >more data to any of the tables and not adding anything else to the database. >It will, for example, go from 3 MB to 4 MB just by opening it and closing >it. > >WHAT IS UP WITH THAT?? > > >Thank you for your time and help!! >Please send comments to: >anv@prodigy.net AND anthony.verrecchia@fmr.com > >Thanks! > > > >
Technical Details
Message-ID:
<35fd2cd9.4709231@news.syspac.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6th9sq$g6ck$1@newssvr04-int.news.prodigy.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff0ac,867b400e6c187fa8 X-Google-Attributes: gidff0ac,public X-Google-Thread: 1668c5,b54851c7c6e6c49d,start X-Google-Attributes: gid1668c5,public From: tomvs@syspac.com (Tom van Stiphout) Subject: Re: quick question on Database Variables Date: 1998/09/14 Message-ID: <35fd2cd9.4709231@news.syspac.com> X-Deja-AN: 391002061 References: <6th9sq$g6ck$1@newssvr04-int.news.prodigy.com> X-Trace: news2.randori.com 905784563 204.181.57.90 (Mon, 14 Sep 1998 07:49:23 PDT) Organization: Mach 2 Systems, Inc. NNTP-Posting-Date: Mon, 14 Sep 1998 07:49:23 PDT Newsgroups: comp.databases.ms-access,at.fido.msaccess