I have a master form.
I have some code which copies the master form to a unique name and opens it. I do this becuase I want to have the form open more then once with different records loaded.
Here is the code
On Error Resume Next
'Delete the form in case it already exists
DoCmd.DeleteObject acForm, Me.t_num
'Make the new form
DoCmd.CopyObject , (Me.t_num), acForm, "Target_Stores_MRRS"
'Open the new form
DoCmd.OpenForm Me.t_num, acNormal
Here is what is happening.
The first time I run it it copies the master form to the new form named to the value of Me.t_num and then opens it.
when the code runs again with a different value for Me.t_num, it closes the first form opened and then opens the new form. The first form still exists. Why is it closing?
I have some code which copies the master form to a unique name and opens it. I do this becuase I want to have the form open more then once with different records loaded.
Here is the code
On Error Resume Next
'Delete the form in case it already exists
DoCmd.DeleteObject acForm, Me.t_num
'Make the new form
DoCmd.CopyObject , (Me.t_num), acForm, "Target_Stores_MRRS"
'Open the new form
DoCmd.OpenForm Me.t_num, acNormal
Here is what is happening.
The first time I run it it copies the master form to the new form named to the value of Me.t_num and then opens it.
when the code runs again with a different value for Me.t_num, it closes the first form opened and then opens the new form. The first form still exists. Why is it closing?