parameter problem

  • Thread starter Thread starter cee esimaje via AccessMonster.com
  • Start date Start date
C

cee esimaje via AccessMonster.com

I have a report based on a parameter query where it prompts for criteria to
display on the report. This works fine.

However is there any way to return the "values" typed
in the parameter inputboxes in a unbound textbox on the report.
Thanks in advance
 
Cee,
If you had a parameter like this [Enter Customer ID] (ex. input 1234ABC)
in your report query, then a text control placed on the form with a
RecordSource of...
= "CustomerID = " & [Enter Customer ID]
would display the...
CustomerID = 1234ABC
hth
Al Camp
 
Thanks for this.

However i don't think I fully explained what I wanted to do.
The expression you sent works, but I wanted to limit the number of
parameter input boxes to 2. In my parameter report I have 2 parameter input
boxes asking for the criteria.

ie textbox1 = How long have you lived in the area Years " & [Min years
lived in area] & " - " & [Max years lived in area]

I want the report to read the 2 values typed in the each input box and
return these values to another text box on the report.

The values typed in the parameter input box enables teh user to work out
between which years the report returns records on.

Hope I am making a bit more sense
Thanks once again
 
Are you asking if it's possible to enter 2 values into one parameter input
box?

Sure, but... it's NOT something I would recommend to a casual Access user,
and if you're using those parameter values to control or filter the records
delivered to the report... that's even tougher.

It's very similar to trying to place 2 values in one table field. Down the
road you'll have to go through all kinds of gyrations trying to seperate out
those discreet values.

And, before attempting to do this I would suggest that you have a good
reason for all this extra, complicated, coding.

I'll try to keep an eye out for your reply... I want to be sure I understand
what you need...

Al Camp
 
Al
thanks for your response to this

no I am not asking if 2 values can be entered into one parameter input box

th expresion I used is

textbox1 = How long have you lived in the area Years " & between [Min years
lived in area] and [Max years lived in area]

sorry I posted the wrong parameter expression earlier.

in my parameter if a user types in the 1st input box as in expr above -
[min years] 1
and in the 2nd input box [max years] 23
my report returns all records within this range - which is fine!

However I want to find a way to use these values

ie [min years] where user inputs the 1 in the 1st input box
and 23 in the second [max years] input box


and return them to a text box on the report.

Currently I am getting a third and forth parameter input box
prompting for these values to return to the text box on the report. I dont
want this

What i do want is when the report is opened the 2 parameter boxes are
completed with min years and max years
which returns the records and also displays 1 - 23 in a text boxt on the
report, thus informing anyone reading
a hard copy of the report the range of years that were selected.


The third text box will be used as a title to the report and will show the
year ranges inputted for the parameter
to return the records in the report they are viewing

I thought the only way to do this would be by code ie on the REPORTS OnOpen
event, which would
capture the input box values open the report set the parameters and use the
inputted values
as the control source for the title of the report.

Hope this is a bit clearer
Many THX
 
First, I don't understand why you even ask for a minimum or maximum value.
I've lived in NH for 50 years... not somewhere between 45 and 55! So right
off the bat, I'm confused as to what you're doing...

But, anyhow...
textbox1 = How long have you lived in the area Years " & between [Min
years
lived in area] and [Max years lived in area]
That statement yields "invalid syntax", and I agree.
You are trying to establish a criteria by mixing text ("How long... lived in
the area") and a criteria (Beteween [Min] and [Max]). That won't work

Your query criteria should look like this...
= Between [What is the minimum years you have lived here?] And [What is the
maximum years that you have lived here?]

You will be asked to input 2 individual values into 2 individual input
boxes. If more parameter input boxes come up, then you still have other
parameters in your query, or in other locations on your report.

hth
Al Camp

cee esimaje via AccessMonster.com said:
Al
thanks for your response to this

no I am not asking if 2 values can be entered into one parameter input box

th expresion I used is

textbox1 = How long have you lived in the area Years " & between [Min
years
lived in area] and [Max years lived in area]

sorry I posted the wrong parameter expression earlier.

in my parameter if a user types in the 1st input box as in expr above -
[min years] 1
and in the 2nd input box [max years] 23
my report returns all records within this range - which is fine!

However I want to find a way to use these values

ie [min years] where user inputs the 1 in the 1st input box
and 23 in the second [max years] input box


and return them to a text box on the report.

Currently I am getting a third and forth parameter input box
prompting for these values to return to the text box on the report. I dont
want this

What i do want is when the report is opened the 2 parameter boxes are
completed with min years and max years
which returns the records and also displays 1 - 23 in a text boxt on the
report, thus informing anyone reading
a hard copy of the report the range of years that were selected.


The third text box will be used as a title to the report and will show the
year ranges inputted for the parameter
to return the records in the report they are viewing

I thought the only way to do this would be by code ie on the REPORTS
OnOpen
event, which would
capture the input box values open the report set the parameters and use
the
inputted values
as the control source for the title of the report.

Hope this is a bit clearer
Many THX
 
I know exeacly what you mean but I'm not sure how to go about it myself. I
too want to do that but with dates instead.

example
Box 1
enter start date: 1/1/04

Box 2
enter end date 12/25/04

in report I want to see

This report is based on dates 1/1/04 - 12/25/04

I'm afraid I'm not much help but I do know what you mean.
KB
 
In the Date field of your report, use this criteria...
Between [Enter Starting Date] And [Enter Ending Date]
You will be prompted twice, and then thos e values will be used to filter
the records returned by the query... and delivered to the report.
And... on the report, a text control with =[Enter Starting Date] would
display that value you entered.
Al Camp
 
AL,BabyATX13
Thanks for response
Al,BabyATX13 has explained very succintly what I want to do - I dont know
if you could review that response, and maybe see if there is a way to do
this.

I don't have a problem with the parameter, - that returns the correct
records.

Using the expression you kinldy offered above gives me 4 input boxes.
the first 2 for the query parameter, which I set the control source for the
text box is set to the field with the parameter on the underlying query,

and then another two that you have to repeat the input values again to
return the values to the title text box I am using.

I just want the user to have to input the first 2 query parameter boxes
only, which would then return the records needed for the report, and a
values for title for the report.

Ordinarily, I would use the expression you gave, but I work for a local
authority beleive me I only need to have them input on 2 boxes.

Hearing hoping you can help further
Cee
 
Well Thank you Al :o)
I never would have thought of that.
geeeeeees so simple too.


Thanks
KB

did that answer your question too Cee?
KB
 
KB
No unfortunately as i mentioned in my last post - ordinarily I would use
that method. I think my answer lies in coding. I am not sure how you return
a value in placed in an input box and pass it to 2 or 3 different text
boxes on a report for instance.
Thanks for your help though
Cee
 
I just want to be clear, (example) you want to enter a minimum value of 1
in parameter Box 1 and a Maximum value of 23 in parameter Box 2

You want the report to read
Report includes families in their residence from 1 to 23 years (or
something like that)

To do this place 2 text boxes with their labels in the report header

Go to the properties of the text box and in the control source enter the
first parameter (example) =[parameter1].
Do the same with the second text box =[parameter2]
And in the labels, just have them worded the way you want it to appear.

If I?m way off I am truly sorry I couldn?t be of more help. But from all
you have written that is how I see it.

KB
 
First... don't change your name in threaded posts. Ceebaby... or Cee
esijame or what ever name your using at the moment, only adds to the
confusion involved in this thread.
Second... why didn't you include your query SQL statement? You say it
prompts 4 times for 2 parameters? Then show me the SQL statement...

1. Get the query to run properly...
If you input a parameter value into a query like [Enter a Value] then
that value parameter can be used in the report just like a field. If a
parameter value is used as a criteria in a query multiple times... as long
as each of those parameters is spelled **EXACTLY** the same... you will only
be prompted ONCE!
Check the query Parameter Dialog box AND/OR any criteria entries for
multiple, slightly differently spelled... parameters.
Forget about the report... just get the query to run with 2 prompts for
the 2 parameters, and proper filtering.

2. Get the report to run properly...
If it "appears" as if you are being prompted for the same parameters
more than once, (the report title?) then the following must be true...
That report title parameter is spelled differently ex. query = [Enter a
Value] vs. report = [Enter Value]
If those are **EXACTLY** alike, then I guarantee you that you have a
similar but slightly differently spelled parameter somehwere else on the
report!
Check EVERY field on the report... check EVERY field in any
subreports... check ALL module code or ALL macro code associated with the
report... check any code in any subreports.
If you get another prompt...I guarantee... that bogus parameter is in
there!

hth
Al Camp
 
Back
Top