>>* iKey holds the parameter of the of the p-view JobView >>ThisForm.iKey = INT(VAL(SUBSTR(Node.Key, 5))) >>REQUERY("JobView") >>SELECT "JobView" >>ThisForm.PageFrame1.ActivePage = 4 >>ThisForm.PageFrame1.Page4.Refresh() >>>>
>>WITH This && Form.PageFrame1.Page4 >> * Customer Listbox >> SELECT ; >> Customer.CustName, Customer.CustId; >> FROM ShopTrack!Customer; >> ORDER BY Customer.CustName; >> INTO ARRAY .cboCustomer.laData >> IF _TALLY = 0 >> DIMENSION .cboCustomer.laData[1,1] >> STORE "No Customers" TO .cboCustomer.laData >> ENDIF > >* following is required >.cboCustomer.Requery() >.cboCustomer.Refresh() > >> * Contact Listbox >> SELECT ; >> ALLTRIM(Contacts.LName) + ', ' + ALLTRIM(Contacts.FName) AS ContName,; >> Contacts.ContId; >> FROM ShopTrack!Contacts; >> WHERE Contacts.CustId = INT(VAL(.cboCustomer.List(.cboCustomer.ListIndex, 2))); > >Here you use ListIndex that is zero or invalid just because you did not refreshed Customer combobox. Combobox based on array requires 'Requery' and 'Refresh' after changes in the array. > >> ORDER BY ContName; >> INTO ARRAY .cboContact.laData >> IF _TALLY = 0 >> DIMENSION .cboContact.laData[1,1] >> STORE "No Contacts" TO .cboContact.laData >> ENDIF > >Here requery and refresh recommended too. > >>ENDWITH >>>>
>>Valid empty on both >>InteractiveChange Customer cbo >>WITH This.Parent >> lnCustId = INT(VAL(This.List(This.ListIndex, 2))) >> DIMENSION .cboContact.laData[1,1] >> SELECT ; >> ALLTRIM(Contacts.LName) + ', ' + ALLTRIM(Contacts.FName) AS ContName,; >> Contacts.ContId; >> FROM ShopTrack!Contacts; >> WHERE Contacts.CustId = lnCustId; >> ORDER BY ContName; >> INTO ARRAY .cboContact.laData >> IF _TALLY = 0 >> STORE "No Contacts" TO .cboContact.laData >> ENDIF >> .cboContact.Requery() >> .cboContact.ListIndex = 1 >>ENDWITH >> >>BountColumn 2 on both >>BoundTo .t. on both >>ControlSource jobview.custid and jobview.contid >>RowSourceType array >>RowSource (or code that fills it) see above >>>>