Hi,
I have some code that is suppose to run when the database is
opened, I'm hoping it will copy a form from the database that is opened into an existing database on a clients machine, It will over write there form with this new form both forms have the same name.
I don't know where to place the code so that when the database opens it will run it.
Here's the code,
Delete the old form.
Dim cat As New ADOX.Catalog
' Open the Catalog.
cat.ActiveConnection = _
"Provider='Microsoft.Jet.OLEDB.4.0';" & _
"Data Source='C:\Documents and Settings\data\Desktop\est.mdb';"
' Delete the Form.
cat.Forms.Delete "Contractprop"
'Clean up
Set cat.ActiveConnection = Nothing
Set cat = Nothing
'Copy the new form.
DoCmd.CopyObject("C:\Documents and Settings\data\Desktop\est.mdb", "Contractprop", acForm, "Contractprop")
Does any one know where this would get placed?
And does it appear to copy a form from one database into another database?
Thanks--Any help will be greatly appreciated
I have some code that is suppose to run when the database is
opened, I'm hoping it will copy a form from the database that is opened into an existing database on a clients machine, It will over write there form with this new form both forms have the same name.
I don't know where to place the code so that when the database opens it will run it.
Here's the code,
Delete the old form.
Dim cat As New ADOX.Catalog
' Open the Catalog.
cat.ActiveConnection = _
"Provider='Microsoft.Jet.OLEDB.4.0';" & _
"Data Source='C:\Documents and Settings\data\Desktop\est.mdb';"
' Delete the Form.
cat.Forms.Delete "Contractprop"
'Clean up
Set cat.ActiveConnection = Nothing
Set cat = Nothing
'Copy the new form.
DoCmd.CopyObject("C:\Documents and Settings\data\Desktop\est.mdb", "Contractprop", acForm, "Contractprop")
Does any one know where this would get placed?
And does it appear to copy a form from one database into another database?
Thanks--Any help will be greatly appreciated