Select name in one listbox and pull all matching names to second

S

Steve Schapel

Ron,

Ok, how about my other question: What does it in fact show in Listbox 2?

Ok, how about my other other question: Is the Expr1 field in the
[Customer Query] query the name of the customer, and matches the value
of the customer name in [list59].[Column](2)?

If you make a query like this...
SELECT [Customer Query].CustomerID, [Customer Query].Expr1 AS Expr2,
[Customer Query].StartDate, [Customer Query].Phone, [Customer
Query].OrderID
FROM [Customer Query]
WHERE (([Customer Query].Expr1)=[Forms]![OrderDateForm]![CustomerRef])
.... and open the query in datasheet (when the form is open), does the
query return the expected data?
 
R

Ron Weaver

Steve
I just saw you response. I'm sorry I didn't see it earlier. I just figured
this thing out and was in the process of going back in to let everyone know.
This is what I did: First I created a new field "CustomerNumber" and added
it to the Customer Table. I then
assigned each customer a unique number. Then I had to update all effected
queries and forms. Although I don't understand it, I had to position
CustomerName first in listbox 2's guery. I changed The WHERE statement to
'WHERE ((([Customer
Query].CustomerNumber)=[Forms]![OrderDateForm].[list59]));' in listbox 2. Now
it works perfectly. When I select a customer with multiple orders, it pulls
them all down to listbox 2. I want to thank you and everyone who has helped
me with this.

Ron
Steve Schapel said:
Ron,

Ok, how about my other question: What does it in fact show in Listbox 2?

Ok, how about my other other question: Is the Expr1 field in the
[Customer Query] query the name of the customer, and matches the value
of the customer name in [list59].[Column](2)?

If you make a query like this...
SELECT [Customer Query].CustomerID, [Customer Query].Expr1 AS Expr2,
[Customer Query].StartDate, [Customer Query].Phone, [Customer
Query].OrderID
FROM [Customer Query]
WHERE (([Customer Query].Expr1)=[Forms]![OrderDateForm]![CustomerRef])
.... and open the query in datasheet (when the form is open), does the
query return the expected data?

--
Steve Schapel, Microsoft Access MVP

Ron said:
I changed out the listbox 2, trying to fix the problem. It is now list70.
Nothing else has changed. Expr1 is in both listboxes. Listbox 1 is still
list59. If you would like the listbox SQLs I will be happy to send them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top