Re: About Sub Main( )

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi
just leave code as is, perhaps change global to public

then change Sub Main() to Function Main() and create autoexec macro which call it

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

"March" <March@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:DA84DDD3-ECCE-47FC-94C9-D669441B16F8@xxxxxxxxxxxxxxxx
Hello,


Anyone know about sub main( ) VBA in MS Access. I used to write some code
on VB6. I wrote

Option Explicit

Global db as database

Sub main( )

source = "C:\<filename>.mdb"
share = false
Set db = dbengine.workspaces(0).opendatabase(source, share)
<formname>.show

End Sub


above I could use "db" anywhere in my application.

Any idea to declare the "Global" in VBA.

I try to covert the source code to vba. I know that may have some
differences from VB6.

Also, I try to find reference websites.

If anyone have ideas, please give me suggestion.

.



Relevant Pages

  • Re: Handle leak in Windows 2003 Authorization Manager?
    ... Since the sample is in VB6, ... releases it's objects when the sub terminates. ... > keep the Authz context around as long as the app keeps the AzMan context ... > Best regards, ...
    (microsoft.public.platformsdk.security)
  • Re: Bias in rand for excel 07
    ... that was statistically different from expectation. ... Sub SimplerVersion() ... "yttrias" wrote: ... There is no RANDfunction in VBA. ...
    (microsoft.public.excel.programming)
  • Re: Bias in rand for excel 07
    ... F1 with a dynamic formula that will update whenever the RAND() functions ... Sub SimplerVersion() ... "yttrias" wrote: ... There is no RANDfunction in VBA. ...
    (microsoft.public.excel.programming)
  • Re: merging documents into templates - automation problem
    ... The code to launch ... Private Sub UserForm_Initialize ... UserForm_Initialize is an EVENT for the UserForm, called by VBA when the ... the code is in a code module for a form. ...
    (microsoft.public.office.developer.automation)
  • RE:reasons as requested
    ... Sub TestThis() ... > im sure i can get vba to do what i want with this function but at the moment ... as a pivot table for this instance would not ... >> first time it is used from the top. ...
    (microsoft.public.excel.programming)