N
NEWER USER
I have a subform on a form and when Double clicking on a field, another form
opens and displays the same number on the newly opened form as the subform.
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 link form and display same number. 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
Any help appreciated.
Thanks
opens and displays the same number on the newly opened form as the subform.
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 link form and display same number. 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
Any help appreciated.
Thanks