N
NEWER USER
I have a subform on a form and when Double clicking on a field in the
subform, another form
opens and displays the same number on the newly opened form as the subform.
Code on subform as follows:
Private Sub Number_DblClick(Cancel As Integer)
On Error GoTo Number_DblClick_Err
Dim strDoc As String
strDoc = "frmProductSync"
'Synchronize Number field; frmOrderEntryList to frmProductSync
DoCmd.OpenForm strDoc, acNormal, "",
"Number=Forms!frmOrderEntry!fsubOrderEntryList.Form!Number", , acNormal
DoCmd.GoToControl "Number"
Number_DblClick_Exit:
Exit Sub
Number_DblClick_Err:
MsgBox Err.Description
Resume Number_DblClick_Exit
End Sub
This works very well.
I would like to place this subform on several other forms and still have the
ability to open the linked form and display same number as number on
subform. How might I re-work
my code in referencing the main form so I don't have to create several exact
subforms (named differently) when changing the main form reference. Example:
"Number=Forms!frmOrderEntry!fsubOrderEntryList.Form!Number", , acNormal
"Number=Forms!frmGross Profit!fsubOrderEntryList1.Form!Number", , acNormal
"Number=Forms!frmInterchange!fsubOrderEntryList2.Form!Number", , acNormal
I have tried "Number=Me!fsubOrderEntryList.Form!Number thinking "Me" would
reference my Main forms allowing me to use one subform on all forms. No such
luck. I get the Enter Parameter error.
Any help appreciated.
Thanks
subform, another form
opens and displays the same number on the newly opened form as the subform.
Code on subform as follows:
Private Sub Number_DblClick(Cancel As Integer)
On Error GoTo Number_DblClick_Err
Dim strDoc As String
strDoc = "frmProductSync"
'Synchronize Number field; frmOrderEntryList to frmProductSync
DoCmd.OpenForm strDoc, acNormal, "",
"Number=Forms!frmOrderEntry!fsubOrderEntryList.Form!Number", , acNormal
DoCmd.GoToControl "Number"
Number_DblClick_Exit:
Exit Sub
Number_DblClick_Err:
MsgBox Err.Description
Resume Number_DblClick_Exit
End Sub
This works very well.
I would like to place this subform on several other forms and still have the
ability to open the linked form and display same number as number on
subform. How might I re-work
my code in referencing the main form so I don't have to create several exact
subforms (named differently) when changing the main form reference. Example:
"Number=Forms!frmOrderEntry!fsubOrderEntryList.Form!Number", , acNormal
"Number=Forms!frmGross Profit!fsubOrderEntryList1.Form!Number", , acNormal
"Number=Forms!frmInterchange!fsubOrderEntryList2.Form!Number", , acNormal
I have tried "Number=Me!fsubOrderEntryList.Form!Number thinking "Me" would
reference my Main forms allowing me to use one subform on all forms. No such
luck. I get the Enter Parameter error.
Any help appreciated.
Thanks