Hi Tim,
If you open the second form from the first form (say by double-clicking the listbox) you can:
1. base the second form on a query that concatenates the two fields displayed in the listbox, and
2. filter the second form by the bound field from the listbox.
Here's what I mean:
Say your list box lists three fields: CustomerID, CustFirstName, CustLastName. CustomerID is bound. You want the textbox on form two to display the customers full name, i.e., [CustFirstName] & " " & [CustLastName].
First, use the following query as form two's record source:
SELECT
tblCustomers.CustomerID,
[CustFirstName] & " " & [CustLastName] AS CustomerFullName
FROM
tblCustomers;
Bind your textbox on form two to the aliased field in the query (CustomerFullName).
Second, place this code in the listbox's double-click event behind form one:
Private Sub List1_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmCustomer", , , "CustomerID = " & Me![List1]
End Sub
The where condition synchronizes the two forms, and the concatenated field populates your textbox.
HTH,
Bob
|