i wondered if anyone could help me with this.
i have a button on a form (frmUpdateProduct). this button opens up another form (frmSelectSupplier). i have a listbox which gets all the supplier names from the access database, and assigns then with the Supplier ID (also from the database). here is the code for the listbox:
Private Sub form_activate() Set m_colSuppID = Nothing Set m_colSuppID = New Collection strSQL = "SELECT [supplier_ID], [SupplierName] FROM [Supplier]" With con .Open Set RP = .Execute(strSQL) End With With RP lstSupplier.Clear Do Until .EOF lstSupplier.AddItem "" & !supplierName m_colSuppID.Add CStr(!supplier_ID), "" & !SupplierName .MoveNext Loop .Close End With con.Close End Sub
i need to get the supplier name/ supplier id, to be sent to a text box (frmUpdateProduct.TxtSupplier.text). how would i do this?