Need ListBox1 to deliver results to ListBox2

G

Guest

Hi all
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];
Thanks
 
M

Marshall Barton

Ron said:
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];


Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Guest

Thanks for responding.
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2 list boxes
are on and listbox59 is my listbox 1.



Marshall Barton said:
Ron said:
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];


Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
M

Marshall Barton

It's Forms, not Form
--
Marsh
MVP [MS Access]


Ron said:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2 list boxes
are on and listbox59 is my listbox 1.

Ron said:
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];


Marshall Barton said:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Guest

Sorry
Forms!OrderDateForm.listbox59
Marshall Barton said:
It's Forms, not Form
--
Marsh
MVP [MS Access]


Ron said:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2 list boxes
are on and listbox59 is my listbox 1.

Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];


Marshall Barton said:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
M

Marshall Barton

Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.
--
Marsh
MVP [MS Access]


Ron said:
Sorry
Forms!OrderDateForm.listbox59
Marshall Barton said:
It's Forms, not Form


Ron said:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2 list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Guest

It is still asking for the prompt. Listbox 1 is unchanged (my list59). I put
the after update into listbox 1. It is correct. Here is the SQL statement for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59

Marshall Barton said:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.
--
Marsh
MVP [MS Access]


Ron said:
Sorry
Forms!OrderDateForm.listbox59
Marshall Barton said:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2 list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
M

Marshall Barton

That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron said:
It is still asking for the prompt. Listbox 1 is unchanged (my list59). I put
the after update into listbox 1. It is correct. Here is the SQL statement for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


Marshall Barton said:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron said:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2 list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Gina Whipp

Just a thought... Sometimes I have to do this to figure out my typo (you
know, see the forest for the trees)

On the OrderDateForm put a new text box.
Go to Properties of the text box and go to ControlSource and select the
build button.
In the LEFT window find the Forms, double-click and select Loaded Forms.
Find your loaded form in the list.
In the next Window find your field... listbox59 and double-click (if your
list box is not there that could very well be the problem)
In the upper window you should see the Expression... whatever that is copy
that and paste it here for all to see... say okay and leave that textbox
there.
Save and close
Open your form and see what appears in that textbox that was just created
and copy and paste those results here.

HTH,
Gina


Marshall Barton said:
That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron said:
It is still asking for the prompt. Listbox 1 is unchanged (my list59). I
put
the after update into listbox 1. It is correct. Here is the SQL statement
for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


Marshall Barton said:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2
list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a
date range
query.
I would like to be able to select a customer in listbox 1 and
show all past
orders by this customer in listbox 2. First, is this approach ok,
and second
can someone show me how to do it? I have looked everywhere for
examples, but
can't find any. I'm too new to figure this out. Below are the SQL
statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date
Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1,
[Customer
Query].Phone, [Customer Query].StartDate, [Customer
Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Guest

Hi Gina
This is what was in the window:"=[List59]" (copied and pasted).

Gina Whipp said:
Just a thought... Sometimes I have to do this to figure out my typo (you
know, see the forest for the trees)

On the OrderDateForm put a new text box.
Go to Properties of the text box and go to ControlSource and select the
build button.
In the LEFT window find the Forms, double-click and select Loaded Forms.
Find your loaded form in the list.
In the next Window find your field... listbox59 and double-click (if your
list box is not there that could very well be the problem)
In the upper window you should see the Expression... whatever that is copy
that and paste it here for all to see... say okay and leave that textbox
there.
Save and close
Open your form and see what appears in that textbox that was just created
and copy and paste those results here.

HTH,
Gina


Marshall Barton said:
That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron said:
It is still asking for the prompt. Listbox 1 is unchanged (my list59). I
put
the after update into listbox 1. It is correct. Here is the SQL statement
for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2
list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a
date range
query.
I would like to be able to select a customer in listbox 1 and
show all past
orders by this customer in listbox 2. First, is this approach ok,
and second
can someone show me how to do it? I have looked everywhere for
examples, but
can't find any. I'm too new to figure this out. Below are the SQL
statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date
Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1,
[Customer
Query].Phone, [Customer Query].StartDate, [Customer
Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Guest

I know it is wierd. This what happens: Try to load form, get the prompt,
click on the prompt (ok or cancel), get my form, put in the search dates, my
listbox 1 fills in, select a name, get the prompt again, click on ok or
cancel, the prompt goes away but nothing happens. I checked all I know to
check.

Marshall Barton said:
That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron said:
It is still asking for the prompt. Listbox 1 is unchanged (my list59). I put
the after update into listbox 1. It is correct. Here is the SQL statement for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


Marshall Barton said:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2 list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a date range
query.
I would like to be able to select a customer in listbox 1 and show all past
orders by this customer in listbox 2. First, is this approach ok, and second
can someone show me how to do it? I have looked everywhere for examples, but
can't find any. I'm too new to figure this out. Below are the SQL statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Guest

Gina
When I open the form the new text box reads 145 which is the customerID
number for the selected customer. Sorry, I didn't pick up on that before.

Gina Whipp said:
Just a thought... Sometimes I have to do this to figure out my typo (you
know, see the forest for the trees)

On the OrderDateForm put a new text box.
Go to Properties of the text box and go to ControlSource and select the
build button.
In the LEFT window find the Forms, double-click and select Loaded Forms.
Find your loaded form in the list.
In the next Window find your field... listbox59 and double-click (if your
list box is not there that could very well be the problem)
In the upper window you should see the Expression... whatever that is copy
that and paste it here for all to see... say okay and leave that textbox
there.
Save and close
Open your form and see what appears in that textbox that was just created
and copy and paste those results here.

HTH,
Gina


Marshall Barton said:
That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron said:
It is still asking for the prompt. Listbox 1 is unchanged (my list59). I
put
the after update into listbox 1. It is correct. Here is the SQL statement
for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2
list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a
date range
query.
I would like to be able to select a customer in listbox 1 and
show all past
orders by this customer in listbox 2. First, is this approach ok,
and second
can someone show me how to do it? I have looked everywhere for
examples, but
can't find any. I'm too new to figure this out. Below are the SQL
statements
for the two listboxes. I sure would appreciate some help on this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date
Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1,
[Customer
Query].Phone, [Customer Query].StartDate, [Customer
Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Gina Whipp

You get that prompt because intead of listbox59 you need to put list59 and
the prompt should go away if everything else is correct.
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59

Ron Weaver said:
I know it is wierd. This what happens: Try to load form, get the prompt,
click on the prompt (ok or cancel), get my form, put in the search dates,
my
listbox 1 fills in, select a name, get the prompt again, click on ok or
cancel, the prompt goes away but nothing happens. I checked all I know to
check.

Marshall Barton said:
That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron said:
It is still asking for the prompt. Listbox 1 is unchanged (my list59). I
put
the after update into listbox 1. It is correct. Here is the SQL
statement for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2
list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a
date range
query.
I would like to be able to select a customer in listbox 1 and
show all past
orders by this customer in listbox 2. First, is this approach
ok, and second
can someone show me how to do it? I have looked everywhere for
examples, but
can't find any. I'm too new to figure this out. Below are the
SQL statements
for the two listboxes. I sure would appreciate some help on
this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date
Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1,
[Customer
Query].Phone, [Customer Query].StartDate, [Customer
Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Guest

That did it! I can't believe I missed that. Many thanks to you and Marshall
for helping me solve this.

Gina Whipp said:
You get that prompt because intead of listbox59 you need to put list59 and
the prompt should go away if everything else is correct.
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59

Ron Weaver said:
I know it is wierd. This what happens: Try to load form, get the prompt,
click on the prompt (ok or cancel), get my form, put in the search dates,
my
listbox 1 fills in, select a name, get the prompt again, click on ok or
cancel, the prompt goes away but nothing happens. I checked all I know to
check.

Marshall Barton said:
That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron Weaver wrote:
It is still asking for the prompt. Listbox 1 is unchanged (my list59). I
put
the after update into listbox 1. It is correct. Here is the SQL
statement for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2
list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a
date range
query.
I would like to be able to select a customer in listbox 1 and
show all past
orders by this customer in listbox 2. First, is this approach
ok, and second
can someone show me how to do it? I have looked everywhere for
examples, but
can't find any. I'm too new to figure this out. Below are the
SQL statements
for the two listboxes. I sure would appreciate some help on
this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date
Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1,
[Customer
Query].Phone, [Customer Query].StartDate, [Customer
Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Gina Whipp

If you got it working you can now delete the newly created textbox.


Gina Whipp said:
You get that prompt because intead of listbox59 you need to put list59 and
the prompt should go away if everything else is correct.
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59

Ron Weaver said:
I know it is wierd. This what happens: Try to load form, get the prompt,
click on the prompt (ok or cancel), get my form, put in the search dates,
my
listbox 1 fills in, select a name, get the prompt again, click on ok or
cancel, the prompt goes away but nothing happens. I checked all I know to
check.

Marshall Barton said:
That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron Weaver wrote:
It is still asking for the prompt. Listbox 1 is unchanged (my list59).
I put
the after update into listbox 1. It is correct. Here is the SQL
statement for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2
list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a
date range
query.
I would like to be able to select a customer in listbox 1 and
show all past
orders by this customer in listbox 2. First, is this approach
ok, and second
can someone show me how to do it? I have looked everywhere for
examples, but
can't find any. I'm too new to figure this out. Below are the
SQL statements
for the two listboxes. I sure would appreciate some help on
this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date
Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1,
[Customer
Query].Phone, [Customer Query].StartDate, [Customer
Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Gina Whipp

you know the 'forest for the trees' theory... Your welcome


Ron Weaver said:
That did it! I can't believe I missed that. Many thanks to you and
Marshall
for helping me solve this.

Gina Whipp said:
You get that prompt because intead of listbox59 you need to put list59
and
the prompt should go away if everything else is correct.
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59

Ron Weaver said:
I know it is wierd. This what happens: Try to load form, get the prompt,
click on the prompt (ok or cancel), get my form, put in the search
dates,
my
listbox 1 fills in, select a name, get the prompt again, click on ok or
cancel, the prompt goes away but nothing happens. I checked all I know
to
check.

:

That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron Weaver wrote:
It is still asking for the prompt. Listbox 1 is unchanged (my
list59). I
put
the after update into listbox 1. It is correct. Here is the SQL
statement for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these
2
list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of
a
date range
query.
I would like to be able to select a customer in listbox 1
and
show all past
orders by this customer in listbox 2. First, is this
approach
ok, and second
can someone show me how to do it? I have looked everywhere
for
examples, but
can't find any. I'm too new to figure this out. Below are
the
SQL statements
for the two listboxes. I sure would appreciate some help on
this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date
Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1,
[Customer
Query].Phone, [Customer Query].StartDate, [Customer
Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 
G

Guest

Ok
Thanks

Gina Whipp said:
If you got it working you can now delete the newly created textbox.


Gina Whipp said:
You get that prompt because intead of listbox59 you need to put list59 and
the prompt should go away if everything else is correct.
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59

Ron Weaver said:
I know it is wierd. This what happens: Try to load form, get the prompt,
click on the prompt (ok or cancel), get my form, put in the search dates,
my
listbox 1 fills in, select a name, get the prompt again, click on ok or
cancel, the prompt goes away but nothing happens. I checked all I know to
check.

:

That sure sounds strange. You never mentioned mentioned
subforms in this scenario, so that's out. It's hard to
imagine that the OrderDateForm is not open while this is
going on, so that's out too.

The only thing left that I can think of is that the name of
the form or list box is misspelled in some nonobvious way.
--
Marsh
MVP [MS Access]


Ron Weaver wrote:
It is still asking for the prompt. Listbox 1 is unchanged (my list59).
I put
the after update into listbox 1. It is correct. Here is the SQL
statement for
listbox 2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1, [Customer
Query].Phone, [Customer Query].StartDate, [Customer Query].OrderID
FROM [Customer Query]
WHERE ((([Customer
Query].CustomerID)=[Forms]![OrderDateForm].[listbox59]));
The prompt is: Forms!OrderDateForm.listbox59


:
Does that mean it still isn't working or that is now fixed?

If you're still being prompted for something, post a
Copy/Paste of the query's SQL as it stands now. The
**exact** prompt string is critical information so make sure
you post that carefully.


Ron Weaver wrote:
Sorry
Forms!OrderDateForm.listbox59
:
It's Forms, not Form


Ron Weaver wrote:
When I try to open the form, I get an Enter Parameter Box:
"Form!OrderDateForm.listbox59". OrderDateForm is the form these 2
list boxes
are on and listbox59 is my listbox 1.


Ron Weaver wrote:
I have a form with two listboxes. Listbox 1 is the result of a
date range
query.
I would like to be able to select a customer in listbox 1 and
show all past
orders by this customer in listbox 2. First, is this approach
ok, and second
can someone show me how to do it? I have looked everywhere for
examples, but
can't find any. I'm too new to figure this out. Below are the
SQL statements
for the two listboxes. I sure would appreciate some help on
this.
ListBox1:
SELECT [Order Date Query].CustomerID, [Order Date
Query].StartDate, [Order
Date Query].Expr1, [Order Date Query].CustPhone, [Order Date
Query].OrderID
FROM [Order Date Query];
ListBox2:
SELECT [Customer Query].CustomerID, [Customer Query].Expr1,
[Customer
Query].Phone, [Customer Query].StartDate, [Customer
Query].OrderID
FROM [Customer Query];


:
Change the second list box's query to:

SELECT [Customer Query].CustomerID,
[Customer Query].Expr1,
[Customer Query].Phone,
[Customer Query].StartDate,
[Customer Query].OrderID
FROM [Customer Query]
WHERE [Customer Query].CustomerID = Forms!theform.listbox1

Then, add a line of code to listbox1's AfterUpdate event:
Me.listbox2.Requery
 

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