PDA

View Full Version : [Access] How to create duplicate copies of the same form?



spidermman
10-24-2008, 11:27 PM
hi,
i have a form named "sales order form" in my access database.
i would like to have a command button which upon click will create another form of the same template in "sales order form".

i tried this:


Private Sub Command2_Click()
Dim frm As Form

Set frm = CreateForm(, "sales order form")
End Sub


However, it ends up creating a new normal form instead of the "sales order form".

Does anyone knows how to create duplicate copy of the same form?
thanks.

OBP
10-25-2008, 07:26 AM
Try the DoCmd.CopyObject Method

Norie
10-25-2008, 09:48 AM
Why do you need/want to create multiple forms? :huh:

CreganTur
10-27-2008, 05:21 AM
I also wonder why you want your users to copy an existing form with the click of a button. This could be a much bigger headache than you realize. If you do not have any coding in place to delete these forms then your users will fill up your database with these useless, duplicate Forms.

Also, what's the purpose of exactly duplicating an existing form? Are you wanting your users to be able to view 2 copies of the same recordset? If so, then you need to look into the clone method of ADO recordsets.