>Create a "Module" and make the connection public, and then make a "Public Sub Main()" in the same Module
Don't forget to show your first form in this procedure!
>Option Explicit
>Public Conn As ADODB.Connection
>Public Sub Main()
> 'This will open a global connection
> Set Conn = New ADODB.Connection
> With Conn
> 'Change the data source property in the following line
> .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\temp\data\chamber.mdb;Persist Security Info=False"
> .Open
> End With
mdiMain.Show >End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com