Hi Gurus,

I need to add a form to an access database through vb6 application. It should be of the type 'AutoForm: Datasheet' and should be bound to say 'Table1'. The application should save the form, close the db and exit.

Here's the beginning:

Dim objAcc As Access.Application
Dim frmAcc As Access.Form
Set objAcc = GetObject("c:\temp\vank97.mdb")
Set frmAcc = objAcc.Forms.Application.CreateForm(, "Table1")
frmAcc.RecordSource = "Table1"
Set frmAcc = Nothing
Set objAcc = Nothing
The problem I had with this code is that it bound only to 97 version databases while XP versions gave an 'Automation Error'. The database I'll be using might be of either versions.