Parameter query with combo doesn't work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have spent the last two hours reviewing combo box+parameter query threads
spent the last two hours and trying to make it work in my database. Thank
you for the great posts - a lot of them were helpful. I also stepped through
the article in www.fontstuff.com/access/acctut08.htm but I'm still having a
problem - I'm either doing something wrong or missing a step. Anyway, I hope
someone can help me.

Here's my problem:
I created a form with a combo box and an OK and Cancel button per the
article above. As a combo box, it works AND runs the query. (I have my run
query as an Event Procedure in the After Update property per a post I saw in
here). As a query, I cannot get it to run the form although my criteria on
that field says Forms!FormName!cboLookup (per an earlier post and also the
article - I built the criteria using Builder so there would be no syntax
error).

I have a report based on the query so I need the query to run the form so
that when I run the report it will run the query which will run the form
(whew!).

If someone can help, I would really appreciate it!
Thank you,
Gillian
 
A query will not open a form for you. You must open the form yourself before
the query is run.
 
Bummer.

Is there anyway then that I can do what I need to do? Which is run a report
which is built on query which pulls its criteria from the combo box on my
form?

Thanks
 
I did so - in a database that I don't have here with me - by including a
macro in my report's open event which called the form to open.

Unfortunately, I don't have the details here with me.
 
You would run code in the On Open event of the report to open the form in
dialog mode. Have a command button on the form that sets its Visible
property to False.
 
Dear Gillian:

What is very typical is to put the control to run the report on a form. Put
the controls that define what will be reported, like this combo box, on that
same form. Then do as Steve suggested.

Tom Ellison
Microsoft Access MVP
 
Thank you - it worked! I created a Preview Report button on the dialog box
form AND a Print Report button. It looks great! I appreciate everyone's help.

Warm regards,
Gillian
 
GillianHG said:
*Hello,

I have spent the last two hours reviewing combo box+parameter quer
threads
spent the last two hours and trying to make it work in my database.
Thank
you for the great posts - a lot of them were helpful. I also steppe
through
the article in www.fontstuff.com/access/acctut08.htm but I'm stil
having a
problem - I'm either doing something wrong or missing a step.
Anyway, I hope
someone can help me.

Here's my problem:
I created a form with a combo box and an OK and Cancel button pe
the
article above. As a combo box, it works AND runs the query. (I hav
my run
query as an Event Procedure in the After Update property per a post
saw in
here). As a query, I cannot get it to run the form although m
criteria on
that field says Forms!FormName!cboLookup (per an earlier post an
also the
article - I built the criteria using Builder so there would be n
syntax
error).

I have a report based on the query so I need the query to run th
form so
that when I run the report it will run the query which will run th
form
(whew!).

If someone can help, I would really appreciate it!
Thank you,
Gillian *

I have had the same problem. I created the form, added the combo bo
and that works fine. I updated the query criteria with the form an
control name. I open the form and do the lookup in the combo box, the
go to the query and run it and get no results. It's like the control i
the form is not being populated with the value I selected and i
displayed. Is there something on the form def I'm missing?

Thans,
Dan Fabec


-
Dmfabe
 
Back
Top