I have two forms in vb 6.
Both have the basic data from the recordset. The second form groups the customers by lastname, firstname on a listbox. There are also textboxes on the second form which shows the CustomerID which is the unique identifier.
What I want to do is to be able to click a button or on the name in the listbox and have that record on form 1 ( ie customers.form) to move the recordset to the correct customer so they match.
The code for the listbox on form 2 is posted
Is there a way to click on the name in the listbox and force the recordset in form 1 to match? They would need to match with the CustomerID as that is the primary key and the unique identifier, although the user does not see the customerID.
Private Sub lstContacts_Click()
'Update Contact Detail data (replace null values with empty strings to prevent errors)
.Filter = "CustomerID='" & aContactIDs(lstContacts.ListIndex) & "'"
txtTitle.Text = myNZ(!Title, "")
txtFirstName.Text = myNZ(!firstname, "")
txtLastName.Text = myNZ(!lastName, "")
txtAddress.Text = myNZ(!Address, "")
txtCity.Text = myNZ(!City, "")
txtState.Text = myNZ(!State, "")
txtZIP.Text = myNZ(!ZIP, "")
txtPhone.Text = myNZ(!Phone, "")
txtCell.Text = myNZ(!Cell, "")
txtCustomerID.Text = myNZ(!Customerid, "")