Report Generated from a query

G

Guest

I'm trying to create a report that is generated from a query. When I open
the report, I'd like the opportunity to refine the search based on a list of
sales people. I was trying to use the following in the query:

=Forms![formname]![controlsource]

where "formname" is the name of the form that will display the drop down box
with the list of sales people and "controlsource" is the name of the combo
box within the form. Everytime I try to do this and run the query, I end up
with an "enter parameter value" dialogue box. So, basically, the query
doesn't know what I'm talking about when trying to define the form. What am
I doing wrong?? Can anyone help???
 
G

Guest

Few things I would check
1. Is the form still open when the report runs?
2. Check the names of the form and combo again
3. The combo placed on a form, or sub form, if subform the path would be
different
Forms![FormName]![SubFormName].Form![ComboName]
4. When the form runs, open the immidiate window (press Ctrl+G), and type
?Forms![formname]![controlsource]
Press enter to see if it returns a value, or if you getting an error.
 
G

Guest

Hey Ofer,

Thanks for the reply. I'm really struggling with this, the sad part is I'm
probably doing something wrong that is really simple. Anyway, when I put the
path in the criteria of the query, =Forms![Formname]![ControlSource], and hit
enter, Access automatically changes what I've typed to
=[Forms]![Formname]![ControlSource]. This makes sense to me for the formname
and controlsource, but should "Forms" have brackets around it? Also, when I
open the immediate window and type in what you suggested, I get a value, but
it's "null." Does that make sense?

Thanks again!
John

Ofer said:
Few things I would check
1. Is the form still open when the report runs?
2. Check the names of the form and combo again
3. The combo placed on a form, or sub form, if subform the path would be
different
Forms![FormName]![SubFormName].Form![ComboName]
4. When the form runs, open the immidiate window (press Ctrl+G), and type
?Forms![formname]![controlsource]
Press enter to see if it returns a value, or if you getting an error.

--
I hope that helped
Good luck


JLS04 said:
I'm trying to create a report that is generated from a query. When I open
the report, I'd like the opportunity to refine the search based on a list of
sales people. I was trying to use the following in the query:

=Forms![formname]![controlsource]

where "formname" is the name of the form that will display the drop down box
with the list of sales people and "controlsource" is the name of the combo
box within the form. Everytime I try to do this and run the query, I end up
with an "enter parameter value" dialogue box. So, basically, the query
doesn't know what I'm talking about when trying to define the form. What am
I doing wrong?? Can anyone help???
 
G

Guest

The forms should have brackets in a query.
If you didn't select anything in the combo, and you checked the value of the
field in the immidiate windows, you'll get null, if that the case try and
select a value and then check if you have the right selection returned.

--
I hope that helped
Good luck


JLS04 said:
Hey Ofer,

Thanks for the reply. I'm really struggling with this, the sad part is I'm
probably doing something wrong that is really simple. Anyway, when I put the
path in the criteria of the query, =Forms![Formname]![ControlSource], and hit
enter, Access automatically changes what I've typed to
=[Forms]![Formname]![ControlSource]. This makes sense to me for the formname
and controlsource, but should "Forms" have brackets around it? Also, when I
open the immediate window and type in what you suggested, I get a value, but
it's "null." Does that make sense?

Thanks again!
John

Ofer said:
Few things I would check
1. Is the form still open when the report runs?
2. Check the names of the form and combo again
3. The combo placed on a form, or sub form, if subform the path would be
different
Forms![FormName]![SubFormName].Form![ComboName]
4. When the form runs, open the immidiate window (press Ctrl+G), and type
?Forms![formname]![controlsource]
Press enter to see if it returns a value, or if you getting an error.

--
I hope that helped
Good luck


JLS04 said:
I'm trying to create a report that is generated from a query. When I open
the report, I'd like the opportunity to refine the search based on a list of
sales people. I was trying to use the following in the query:

=Forms![formname]![controlsource]

where "formname" is the name of the form that will display the drop down box
with the list of sales people and "controlsource" is the name of the combo
box within the form. Everytime I try to do this and run the query, I end up
with an "enter parameter value" dialogue box. So, basically, the query
doesn't know what I'm talking about when trying to define the form. What am
I doing wrong?? Can anyone help???
 
K

Kari

This doesn't seem to be the Original Posters problem, but for others I'd like
to clarify #3. The path should be
Forms![FormName]![SubFormControlName].Form![ComboName] Note that the SubForm
Name and the SubForm Control Name are not neccessarily the same. The SubForm
Control Name can be found by opening the main form in design view, selecting
the subform, opening the properties window, clicking the "Other" tab and
looking at the name property.

The differences and nuances between the SubForm Name and the SubForm Control
Name are discussed elsewhere on these boards, but I wanted to make a note
here in case someone was stuck.

Good luck!

Ofer said:
Few things I would check
1. Is the form still open when the report runs?
2. Check the names of the form and combo again
3. The combo placed on a form, or sub form, if subform the path would be
different
Forms![FormName]![SubFormName].Form![ComboName]
4. When the form runs, open the immidiate window (press Ctrl+G), and type
?Forms![formname]![controlsource]
Press enter to see if it returns a value, or if you getting an error.

--
I hope that helped
Good luck


JLS04 said:
I'm trying to create a report that is generated from a query. When I open
the report, I'd like the opportunity to refine the search based on a list of
sales people. I was trying to use the following in the query:

=Forms![formname]![controlsource]

where "formname" is the name of the form that will display the drop down box
with the list of sales people and "controlsource" is the name of the combo
box within the form. Everytime I try to do this and run the query, I end up
with an "enter parameter value" dialogue box. So, basically, the query
doesn't know what I'm talking about when trying to define the form. What am
I doing wrong?? Can anyone help???
 

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