parameter problem on opening of form

L

leon

I have an issue with an unbound form I really do not understand.

The form has 1 combobox and 3 listboxes
The rowsource of the 3 listboxes is empty when I open the form. When I
update the combobox the Rowsources of the listboxes is being filled
with three different queries and the listboxes are requeried after
that. The 3 queries are all depending on a parameter which is in the
combobox so there should be no problem.

The strange thing is that when i put the first two listboxes in the
form everything went ok. The problem came in when i put in the third
list box in the form. All of a sudden when i now open the form it
starts asking for the parameter which is of course not filled yet
since i haven't even been able to touch the combobox to select a value
which can be used as a parameter.

When i remove the third listbox the problem is gone.

Does anybody kmow how i can prevent this from happening or why this
happens in the first place? I really do not understand this at all.
 
G

Graham Mandeno

Hi Leon

You will need to provide more information. What is the name of the combobox
and what is the RowSource of the third listbox?
 
L

leon

The combobox is called Combo0
the rowsource of the third listbox is empty (the same goes for the
other two listboxes by the way)until I have selected a value in combo0
.. In the after update event of combo zero I have written the following
code:

Me.rowsource.listbox1 = "qry_x"
Me.listbox1.requery
Me.rowsource.listbox2 = "qry_y"
Me.listbox2.requery
Me.rowsource.listbox3 = "qry_z"
Me.listbox3.requery

All query's contain the same parameter: The value in Combo0

I did not give the listboxes a rowsource on forehand because then the
same problem seems to occur: when opening the form it starts asking
for the parameter. Therefore the rowsource of the istboxes is filled
out only when I update combo0. This worked fine until I added listbox
3

Graham Mandeno said:
Hi Leon

You will need to provide more information. What is the name of the combobox
and what is the RowSource of the third listbox?
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

leon said:
I have an issue with an unbound form I really do not understand.

The form has 1 combobox and 3 listboxes
The rowsource of the 3 listboxes is empty when I open the form. When I
update the combobox the Rowsources of the listboxes is being filled
with three different queries and the listboxes are requeried after
that. The 3 queries are all depending on a parameter which is in the
combobox so there should be no problem.

The strange thing is that when i put the first two listboxes in the
form everything went ok. The problem came in when i put in the third
list box in the form. All of a sudden when i now open the form it
starts asking for the parameter which is of course not filled yet
since i haven't even been able to touch the combobox to select a value
which can be used as a parameter.

When i remove the third listbox the problem is gone.

Does anybody kmow how i can prevent this from happening or why this
happens in the first place? I really do not understand this at all.
 
L

leon

Anyone?
The combobox is called Combo0
the rowsource of the third listbox is empty (the same goes for the
other two listboxes by the way)until I have selected a value in combo0
. In the after update event of combo zero I have written the following
code:

Me.rowsource.listbox1 = "qry_x"
Me.listbox1.requery
Me.rowsource.listbox2 = "qry_y"
Me.listbox2.requery
Me.rowsource.listbox3 = "qry_z"
Me.listbox3.requery

All query's contain the same parameter: The value in Combo0

I did not give the listboxes a rowsource on forehand because then the
same problem seems to occur: when opening the form it starts asking
for the parameter. Therefore the rowsource of the istboxes is filled
out only when I update combo0. This worked fine until I added listbox
3

Graham Mandeno said:
Hi Leon

You will need to provide more information. What is the name of the combobox
and what is the RowSource of the third listbox?
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

leon said:
I have an issue with an unbound form I really do not understand.

The form has 1 combobox and 3 listboxes
The rowsource of the 3 listboxes is empty when I open the form. When I
update the combobox the Rowsources of the listboxes is being filled
with three different queries and the listboxes are requeried after
that. The 3 queries are all depending on a parameter which is in the
combobox so there should be no problem.

The strange thing is that when i put the first two listboxes in the
form everything went ok. The problem came in when i put in the third
list box in the form. All of a sudden when i now open the form it
starts asking for the parameter which is of course not filled yet
since i haven't even been able to touch the combobox to select a value
which can be used as a parameter.

When i remove the third listbox the problem is gone.

Does anybody kmow how i can prevent this from happening or why this
happens in the first place? I really do not understand this at all.
 
G

Graham Mandeno

Hi Leon

Sorry, I was away yesterday, but I guess no one else answered you either,
because you still have not provided enough information to even guess what
the problem might be.

The code you have posted below is not possible because it won't compile.
There is no such thing as Me.rowsource. What you must have is:
Me.listbox1.RowSource = "qry_x"
....etc

However, for it to ask for a parameter when the form opens, there must be
something in the form at design time which requires that parameter. What is
the parameter being requested? Is it:
[Forms]![YourFormName]![Combo0] ?
If it is not, then you are looking in the wrong place.

I strongly suspect that the RowSource of listbox3 has nothing to do with the
problem. There should be no problem with defining the RowSources at design
time, referring to a combo box that happens to have a null value. It just
means that there will be no records displayed in the listbox.

Try to post some more relevant information. For example, the SQL of the
rowsource query. Also, copy and paste the *real* code, not something you
make up as you type your news post. And what *is* the parameter being
requested?
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

leon said:
The combobox is called Combo0
the rowsource of the third listbox is empty (the same goes for the
other two listboxes by the way)until I have selected a value in combo0
. In the after update event of combo zero I have written the following
code:

Me.rowsource.listbox1 = "qry_x"
Me.listbox1.requery
Me.rowsource.listbox2 = "qry_y"
Me.listbox2.requery
Me.rowsource.listbox3 = "qry_z"
Me.listbox3.requery

All query's contain the same parameter: The value in Combo0

I did not give the listboxes a rowsource on forehand because then the
same problem seems to occur: when opening the form it starts asking
for the parameter. Therefore the rowsource of the istboxes is filled
out only when I update combo0. This worked fine until I added listbox
3

Graham Mandeno said:
Hi Leon

You will need to provide more information. What is the name of the
combobox
and what is the RowSource of the third listbox?
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

leon said:
I have an issue with an unbound form I really do not understand.

The form has 1 combobox and 3 listboxes
The rowsource of the 3 listboxes is empty when I open the form. When I
update the combobox the Rowsources of the listboxes is being filled
with three different queries and the listboxes are requeried after
that. The 3 queries are all depending on a parameter which is in the
combobox so there should be no problem.

The strange thing is that when i put the first two listboxes in the
form everything went ok. The problem came in when i put in the third
list box in the form. All of a sudden when i now open the form it
starts asking for the parameter which is of course not filled yet
since i haven't even been able to touch the combobox to select a value
which can be used as a parameter.

When i remove the third listbox the problem is gone.

Does anybody kmow how i can prevent this from happening or why this
happens in the first place? I really do not understand this at all.
 
L

leon

Graham,

I will post the exact code and sql but it will make things a little
bit more complicated but i guess that does not matter

The exact code in the after update event of the combobox (which is
called combo0 by the way is:

Me.List10.RowSource = "qry_form_sum_differences"
Me.List10.Requery
Me.List12.RowSource = "qry_form_sum_cpty_amounts"
Me.List12.Requery
Me.List14.RowSource = "qry_form_unmatched_statistics"
Me.List14.Requery
Me.List25.RowSource = "qry_form_sum_own_amounts"
Me.List25.Requery
Me.List33.RowSource = "qry_form_financial_differences"
Me.List33.Requery

All listboxes do not (or should not) have a rowsource when the form is
opened.

The sequel on qry "qry_form_financial_differences" which is the one
that seems to be causing the problem is:

PARAMETERS [Forms]![frm_matching_info]![Combo0] Text ( 255 );
SELECT qry_eur_totals_per_account_own.[Internal Counterparty],
Round((qry_eur_totals_per_account_own![10010421]+qry_eur_totals_per_account_ctpy![10012221])/1000,0)
AS 421, Round((qry_eur_totals_per_account_own![10012221]+qry_eur_totals_per_account_ctpy![10010421])/1000,0)
AS 2221, Round((qry_eur_totals_per_account_own![Total Of Balance
Reporting Figure]+qry_eur_totals_per_account_ctpy![Total Of Balance
Reporting Figure])/1000,0) AS totals,
qry_eur_totals_per_account_own![Total count of
trades]-qry_eur_totals_per_account_ctpy![Total count of trades] AS
Expr1
FROM qry_eur_totals_per_account_ctpy INNER JOIN
qry_eur_totals_per_account_own ON
qry_eur_totals_per_account_ctpy.[Reporting Entity] =
qry_eur_totals_per_account_own.[Internal Counterparty]
WHERE (((qry_eur_totals_per_account_own.[Internal
Counterparty])=[Forms]![frm_matching_info]![Combo0]));

Basically the problem itself is really simple : On opening of the form
it starts asking for the parameter in the parameter query. I do not
want this to happen, moreover I really do not understand why this is
happening since the rowsources of the listboxes haven't even been
populated on opening the form


I would be really greatfull if you could help me with this.

Kind regards,

Léon





Graham Mandeno said:
Hi Leon

Sorry, I was away yesterday, but I guess no one else answered you either,
because you still have not provided enough information to even guess what
the problem might be.

The code you have posted below is not possible because it won't compile.
There is no such thing as Me.rowsource. What you must have is:
Me.listbox1.RowSource = "qry_x"
...etc

However, for it to ask for a parameter when the form opens, there must be
something in the form at design time which requires that parameter. What is
the parameter being requested? Is it:
[Forms]![YourFormName]![Combo0] ?
If it is not, then you are looking in the wrong place.

I strongly suspect that the RowSource of listbox3 has nothing to do with the
problem. There should be no problem with defining the RowSources at design
time, referring to a combo box that happens to have a null value. It just
means that there will be no records displayed in the listbox.

Try to post some more relevant information. For example, the SQL of the
rowsource query. Also, copy and paste the *real* code, not something you
make up as you type your news post. And what *is* the parameter being
requested?
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

leon said:
The combobox is called Combo0
the rowsource of the third listbox is empty (the same goes for the
other two listboxes by the way)until I have selected a value in combo0
. In the after update event of combo zero I have written the following
code:

Me.rowsource.listbox1 = "qry_x"
Me.listbox1.requery
Me.rowsource.listbox2 = "qry_y"
Me.listbox2.requery
Me.rowsource.listbox3 = "qry_z"
Me.listbox3.requery

All query's contain the same parameter: The value in Combo0

I did not give the listboxes a rowsource on forehand because then the
same problem seems to occur: when opening the form it starts asking
for the parameter. Therefore the rowsource of the istboxes is filled
out only when I update combo0. This worked fine until I added listbox
3

Graham Mandeno said:
Hi Leon

You will need to provide more information. What is the name of the
combobox
and what is the RowSource of the third listbox?
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

I have an issue with an unbound form I really do not understand.

The form has 1 combobox and 3 listboxes
The rowsource of the 3 listboxes is empty when I open the form. When I
update the combobox the Rowsources of the listboxes is being filled
with three different queries and the listboxes are requeried after
that. The 3 queries are all depending on a parameter which is in the
combobox so there should be no problem.

The strange thing is that when i put the first two listboxes in the
form everything went ok. The problem came in when i put in the third
list box in the form. All of a sudden when i now open the form it
starts asking for the parameter which is of course not filled yet
since i haven't even been able to touch the combobox to select a value
which can be used as a parameter.

When i remove the third listbox the problem is gone.

Does anybody kmow how i can prevent this from happening or why this
happens in the first place? I really do not understand this at all.
 
G

Graham Mandeno

Time for some detective work, Leon :)

1. Can you confirm that the parameter being asked for is
"[Forms]![frm_matching_info]![Combo0]"?

2. Carefully verify that all the properties of List33 are as you say they
are in design view - particularly RowSource.

3. Take a backup copy of your original form. On the original copy, delete
List33 and comment out the two "Me.List33." lines. Does the problem go away?
This will confirm that it is indeed List33 that is causing the problem.

4. If this DOES make the problem disappear, try just opening the form, then
run qry_form_financial_differences from the database window. Does it run
without asking for a parameter?

5. If step 3 does NOT make the parameter go away then you will need to start
looking somewhere else.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand



leon said:
Graham,

I will post the exact code and sql but it will make things a little
bit more complicated but i guess that does not matter

The exact code in the after update event of the combobox (which is
called combo0 by the way is:

Me.List10.RowSource = "qry_form_sum_differences"
Me.List10.Requery
Me.List12.RowSource = "qry_form_sum_cpty_amounts"
Me.List12.Requery
Me.List14.RowSource = "qry_form_unmatched_statistics"
Me.List14.Requery
Me.List25.RowSource = "qry_form_sum_own_amounts"
Me.List25.Requery
Me.List33.RowSource = "qry_form_financial_differences"
Me.List33.Requery

All listboxes do not (or should not) have a rowsource when the form is
opened.

The sequel on qry "qry_form_financial_differences" which is the one
that seems to be causing the problem is:

PARAMETERS [Forms]![frm_matching_info]![Combo0] Text ( 255 );
SELECT qry_eur_totals_per_account_own.[Internal Counterparty],
Round((qry_eur_totals_per_account_own![10010421]+qry_eur_totals_per_account_ctpy![10012221])/1000,0)
AS 421,
Round((qry_eur_totals_per_account_own![10012221]+qry_eur_totals_per_account_ctpy![10010421])/1000,0)
AS 2221, Round((qry_eur_totals_per_account_own![Total Of Balance
Reporting Figure]+qry_eur_totals_per_account_ctpy![Total Of Balance
Reporting Figure])/1000,0) AS totals,
qry_eur_totals_per_account_own![Total count of
trades]-qry_eur_totals_per_account_ctpy![Total count of trades] AS
Expr1
FROM qry_eur_totals_per_account_ctpy INNER JOIN
qry_eur_totals_per_account_own ON
qry_eur_totals_per_account_ctpy.[Reporting Entity] =
qry_eur_totals_per_account_own.[Internal Counterparty]
WHERE (((qry_eur_totals_per_account_own.[Internal
Counterparty])=[Forms]![frm_matching_info]![Combo0]));

Basically the problem itself is really simple : On opening of the form
it starts asking for the parameter in the parameter query. I do not
want this to happen, moreover I really do not understand why this is
happening since the rowsources of the listboxes haven't even been
populated on opening the form


I would be really greatfull if you could help me with this.

Kind regards,

Léon





Graham Mandeno said:
Hi Leon

Sorry, I was away yesterday, but I guess no one else answered you either,
because you still have not provided enough information to even guess what
the problem might be.

The code you have posted below is not possible because it won't compile.
There is no such thing as Me.rowsource. What you must have is:
Me.listbox1.RowSource = "qry_x"
...etc

However, for it to ask for a parameter when the form opens, there must be
something in the form at design time which requires that parameter. What
is
the parameter being requested? Is it:
[Forms]![YourFormName]![Combo0] ?
If it is not, then you are looking in the wrong place.

I strongly suspect that the RowSource of listbox3 has nothing to do with
the
problem. There should be no problem with defining the RowSources at
design
time, referring to a combo box that happens to have a null value. It
just
means that there will be no records displayed in the listbox.

Try to post some more relevant information. For example, the SQL of the
rowsource query. Also, copy and paste the *real* code, not something you
make up as you type your news post. And what *is* the parameter being
requested?
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

leon said:
The combobox is called Combo0
the rowsource of the third listbox is empty (the same goes for the
other two listboxes by the way)until I have selected a value in combo0
. In the after update event of combo zero I have written the following
code:

Me.rowsource.listbox1 = "qry_x"
Me.listbox1.requery
Me.rowsource.listbox2 = "qry_y"
Me.listbox2.requery
Me.rowsource.listbox3 = "qry_z"
Me.listbox3.requery

All query's contain the same parameter: The value in Combo0

I did not give the listboxes a rowsource on forehand because then the
same problem seems to occur: when opening the form it starts asking
for the parameter. Therefore the rowsource of the istboxes is filled
out only when I update combo0. This worked fine until I added listbox
3

Hi Leon

You will need to provide more information. What is the name of the
combobox
and what is the RowSource of the third listbox?
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

I have an issue with an unbound form I really do not understand.

The form has 1 combobox and 3 listboxes
The rowsource of the 3 listboxes is empty when I open the form. When
I
update the combobox the Rowsources of the listboxes is being filled
with three different queries and the listboxes are requeried after
that. The 3 queries are all depending on a parameter which is in the
combobox so there should be no problem.

The strange thing is that when i put the first two listboxes in the
form everything went ok. The problem came in when i put in the third
list box in the form. All of a sudden when i now open the form it
starts asking for the parameter which is of course not filled yet
since i haven't even been able to touch the combobox to select a
value
which can be used as a parameter.

When i remove the third listbox the problem is gone.

Does anybody kmow how i can prevent this from happening or why this
happens in the first place? I really do not understand this at all.
 

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