On a form I have the following code
I need to repeat the same code on another form, so I want to make the private sub routine public in a module
In the public version the following will change:
Forms![frmCustomer]![frmCustomerContacts]
Forms![frmCustomer]![frmCustomerContacts].Form!frmCustomerContactDetails
Name of list box. In above code it is "lstCustomerContacts"
How do I do this?
Thanks in advance
Code:
Private Sub ShowCustomerContactDetailsForm()
Forms![frmCustomer]![frmCustomerContacts].Form!lngCustomerContactId = Forms![frmCustomer]![frmCustomerContacts].Form!lstCustomerContacts.ItemData(0)
Forms![frmCustomer]![frmCustomerContacts].Form!lstCustomerContacts.Selected(0) = True
Forms![frmCustomer]![frmCustomerContacts].Form!frmCustomerContactDetails.Visible = True
Forms![frmCustomer]![frmCustomerContacts].Form!frmCustomerContactDetails.Requery
End Sub
I need to repeat the same code on another form, so I want to make the private sub routine public in a module
In the public version the following will change:
Forms![frmCustomer]![frmCustomerContacts]
Forms![frmCustomer]![frmCustomerContacts].Form!frmCustomerContactDetails
Name of list box. In above code it is "lstCustomerContacts"
How do I do this?
Thanks in advance