Thanks Brian
I may take you up on that. I just looked at the Customer Query. It is in the
SQL statement along with formatting for the phone. I don't know why it's not
in the row source in listbox 2. Should it be?
Thanks for hanging in there with me.
:
Ron,
Are you saying that your List59 is being filtered by date? I don't see a
where clause in its rowsource.
Tell you what: if you want me to take a quick look at your db, you'll need
to compact it, save a copy of it in A2000 file format or earlier, change the
file extension from .mdb to .xxx, and zip it up. You can send it to me at:
bastelER<at>alltelER<dot>net
'remove capitalized letters and change punctuation appropriately
Otherwise, I can't help without knowing alot more about your form, its
recordsource, the names of the pertinent tables and respective fieldnames
pertaining to the listboxes, etc.
Brian
Brian
It doesn't work. I left listbox 1 alone because it had all the fields. On
listbox 2, I changed CustomerName to Expr1 in two places. The listbox
remains
blank. Before I put this code in it was pulling a single name to listbox 2
based on CustomerID. I have checked for miss spelling, etc. The way this
form
works is: When the form is opened, the listboxes are blank. There are two
text fields. One for StartDate and one for EndDate. After these are
filled, I
click on a control which refreshes the form and populates list 1. When I
select a record in listbox 1, that populates listbox 2. Both listboxes are
bound to one column.
I hope this helps.
:
Ron,
I just reversed the rowsource order for List59 so that Expr1 (customer
name)
is the first column. Assuming that the Listbox does NOT have a control
source, set the bound column to 1. You'll need to requery List111 in the
After Update event of List59.
..List59: (listbox 1)
SELECT [Order Date Query].Expr1, [Order Date Query].StartDate, [Order
Date Query].CustomerID, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
List111: (listbox 2)
SELECT [Customer Query].CustomerID, [Customer Query].[CustomerName],
[Customer Query].StartDate, [Customer Query].Phone, [Customer
Query].OrderID
FROM [Customer Query]
WHERE ((([Customer Query].CustomerName) Like "*" &
[Forms]![OrderDateForm].[list59] & "*"));
Brian
Brian
The customers name is in "Expr1" Please show me how the SQLs should
read.
Thanks
:
Ron,
Since you want the second listbox to show 'all' matching names, then
you
can't filter on CustomerID. You'll have to incorporate the
Customer's
name
into the rowsource for List59, so you'll have to modify the SQL
(below)
for
both listboxes to reflect the actual CustomerName and Customers
Table.
There may be better ways to do it, but hopefully this will give a
decent
jumping off point.
Brian
..List59: (listbox 1)
SELECT [tblCustomers].CustomerName, [Order Date Query].StartDate,
[Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query]
INNER JOIN tblCustomers ON
[Order Date Query].[CustomerID] = [tblCustomers].[CustomerID];
List111: (listbox 2)
SELECT [Customer Query].CustomerID, [Customer Query].[CustomerName],
[Customer Query].StartDate, [Customer Query].Phone, [Customer
Query].OrderID
FROM [Customer Query]
WHERE ((([Customer Query].CustomerName) Like "*" &
[Forms]![OrderDateForm].[list59] & "*"));