I have an application that copies forms, repots and queries from the current database to another database.
I am using the code:
Select Case strObjectType
Case "Form"
DoCmd.CopyObject strDestDbFilePath, strObjectName, acForm, strObjectName
Case "Query"
DoCmd.CopyObject strDestDbFilePath, strObjectName, acQuery, strObjectName
Case "Report"
DoCmd.CopyObject strDestDbFilePath, strObjectName, acReport, strObjectName
End Select
where strObjectName is a string referring to the object name to be copied and strDestDbFilePath is the file path of the destination database.
It is all working, but for forms, it is copying only the form and its controls and not the form module. Therefore none of the buttons or after update events work.
Does anyone have any idea why this is happening and what I can do to sort it out?
PS I am using Access 2002
I am using the code:
Select Case strObjectType
Case "Form"
DoCmd.CopyObject strDestDbFilePath, strObjectName, acForm, strObjectName
Case "Query"
DoCmd.CopyObject strDestDbFilePath, strObjectName, acQuery, strObjectName
Case "Report"
DoCmd.CopyObject strDestDbFilePath, strObjectName, acReport, strObjectName
End Select
where strObjectName is a string referring to the object name to be copied and strDestDbFilePath is the file path of the destination database.
It is all working, but for forms, it is copying only the form and its controls and not the form module. Therefore none of the buttons or after update events work.
Does anyone have any idea why this is happening and what I can do to sort it out?
PS I am using Access 2002