Forum Discussion

Sue_69's avatar
Sue_69
Copper Contributor
Sep 09, 2023
Solved

Northwind Traders Developer 2.2 Template

I think there's a bug in the Northwind Traders Developer 2.2 Template.  When I click the Companies button to open the Customers list, then click a Customer ID, I'm correctly presented with the Custom...
  • Tom_van_Stiphout's avatar
    Sep 10, 2023

    Sue_69 

    Thank you for pointing this out. Yes it is a bug, going back all the way to version 2.0 from April-2023. It probably happened when another subform was copied to become the Contacts subform. Event procedures like “=OpenForm_frmOrderDetails()” are copied with it.
    The solution is to remove the OnClick/OnDblClick properties from the fields in sfrmCompanyDetail_Contacts. There never was a Contacts form; it is not needed in Northwind since all fields from Contacts table are on the subform.

     

    To answer your question how to open a Contacts form if there was one, I would direct you to sfrmCompanyDetail_CustomerOrders, where we are doing an analogous thing: opening the Order that is being clicked on.
    The OrderID is formatted as hyperlink to give a visual indication that it can be clicked on.
    Its Click event calls a function OpenForm_frmOrderDetails(), which is in the code behind this subform. If you want to allow multiple Contact forms to be open at the same time, continue following this code into OpenOrderDetailsForm and implement a similar procedure. If you only want one contact, then a simple DoCmd.OpenForm “yourContactForm”, WhereCondition:=”ContactID=” & Me.txtContactID will do.

Resources