You can use code such as this to test if the form is there:
Dim aca As Access.Application
Dim frm As Form
Dim intReply As Integer
Set aca = New Access.Application
aca.OpenCurrentDatabase "C:\MyFolder\MyDBmdb"
intReply = vbYes
For Each frm In aca.CurrentProject.AllForms
If frm.Name = "NameOfFormInOtherDB" Then
intReply = MsgBox("Form exists. Do you want to replace it?", _
vbYesNo, "Replace Form?")
Exit For
End If
Next frm
aca.CloseCurrentDatabase
aca.Quit
Set aca = Nothing
If intReply = vbYes Then
DoCmd.TransferDatabase acExport, "Microsoft Access",
"C:\MyFolder\MyDBmdb", _
acForm, "NameOfFormInYourDB", "NameOfFormInOtherDB"
End If
--
Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
--
Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/