Parameter Query 2

  • Thread starter Thread starter BruceRS
  • Start date Start date
B

BruceRS

I created a form in which I placed a combo box which lists
teh records I want. I also have created a control button
on the form which refers to a query. When I click on the
control button, it runs the query, but it does not use the
information in the combobox. It appears that I have not
properly got the control button and the combobox talking
with each other. Any help?
 
Hi Bruce
What is the name of the combo box and what is the name of the form?
For example if the form is named Form1 and the combo box is named Combo1, and the control button is to run a query that looks at Combo1 you must adjust the design of your query.
In the design of the query enter a criteria that references the chosen value in Combo1 on Form1 as:

=Forms![Form1].[Combo1]

Hope this helps Cathi :)
 
I created a form in which I placed a combo box which lists
teh records I want. I also have created a control button
on the form which refers to a query. When I click on the
control button, it runs the query, but it does not use the
information in the combobox. It appears that I have not
properly got the control button and the combobox talking
with each other. Any help?

Probably you haven't got the query and the combobox talking. The query
should use

=Forms![name-of-your-form]![name-of-your-combobox]

as a criterion.

If that's not the problem, please post the SQL view of the query and
the VBA code of the button's click event.

Note also that it may be preferable for the user to see a Form (for
onscreen) or Report (for printing) based on the query, rather than the
query datasheet itself.
 
-----Original Message-----
I created a form in which I placed a combo box which lists
teh records I want. I also have created a control button
on the form which refers to a query. When I click on the
control button, it runs the query, but it does not use the
information in the combobox. It appears that I have not
properly got the control button and the combobox talking
with each other. Any help?

Probably you haven't got the query and the combobox talking. The query
should use

=Forms![name-of-your-form]![name-of-your-combobox]

as a criterion.

If that's not the problem, please post the SQL view of the query and
the VBA code of the button's click event.

Note also that it may be preferable for the user to see a Form (for
onscreen) or Report (for printing) based on the query, rather than the
query datasheet itself.


.
John,

Thank you for your comments. It implemented them at home
on AccessXP and all worked well, however, at work where I
use Acess97 when I click the button the query comes up
empty, yet when I run the query by its self it asks for
input.
 
-----Original Message-----
Hi Bruce
What is the name of the combo box and what is the name of the form?
For example if the form is named Form1 and the combo box
is named Combo1, and the control button is to run a query
that looks at Combo1 you must adjust the design of your
query.
In the design of the query enter a criteria that
references the chosen value in Combo1 on Form1 as:
=Forms![Form1].[Combo1]

Hope this helps Cathi :)
.

Thank you for your comments. It implemented them at home
on AccessXP and all worked well, however, at work where I
use Acess97 when I click the button the query comes up
empty, yet when I run the query by its self it asks for
input.
 
Thank you for your comments. It implemented them at home
on AccessXP and all worked well, however, at work where I
use Acess97 when I click the button the query comes up
empty, yet when I run the query by its self it asks for
input.

The technique by itself works fine in A97, I've used it for years!

First doublecheck that the name of the Form and the name of the
textbox are spelled correctly (it's very easy to drop a letter or a
blank or a punctuation mark). If that's all correct, please post the
SQL view of the query.
 
Back
Top