Search criteria between - and

  • Thread starter Thread starter Leif Thorsen
  • Start date Start date
L

Leif Thorsen

I have a table containing let´s say 5 posts – A,B,C,D and E.
Then I make a selecting question with query conditions like “Between C and Hâ€
The result then will be C,D and E.
If I want to make a report from this result and I in the header of this
report want to have

“This report contains posts between C and Hâ€

How will I achive this ???
 
The usual way to give the user a way to select criteria is by unbound
controls on a form. In your case you need a way for the user to select C and
H. You could use a form named FrmCriteria with two comboboxes named
FirstLetter and LastLetter. Your query then would have the criteria:
Between Forms!FrmCriteria!FirstLetter And Forms!FrmCriteria!LastLetter

You would need to insure that the form was open (perhaps not visible) when
the report opened so the recordsource query could find the two criteria
fields.

To get "This report contains posts between C and H" in the report header,
all you need is a textbox in the report header with the following expression
in the control source:
=""This report contains posts between " & Forms!FrmCriteria!FirstLetter & "
and " & Forms!FrmCriteria!LastLetter

<watch for wrapping>

Steve
(e-mail address removed)
 
Steve !!

Thank You for Your answer !!
But is there no way to pick up the expressions inside the two (or four
depending how You see it) brackets [ ] within the query instead for making a
separate form for it ??
The reason for my wish is that I already have a command buttom in form for
"Print me a report" and don´t want to open a new form when I already is
working in one.
 
Steve !!

Thank You for Your answer !!
But is there no way to pick up the expressions inside the two (or four
depending how You see it) brackets [ ] within the query instead for making a
separate form for it ??
The reason for my wish is that I already have a command buttom in form for
"Print me a report" and don´t want to open a new form when I already is
working in one.

You can put textboxes on your current form and reference them; you don't need
to open a separate form.
 
Leif Thorsen said:
Steve !!

Thank You for Your answer !!
But is there no way to pick up the expressions inside the two (or four
depending how You see it) brackets [ ] within the query instead for
making a
separate form for it ??
The reason for my wish is that I already have a command buttom in form for
"Print me a report" and don´t want to open a new form when I already is
working in one.
--
Thanks in advance for Your help


Steve said:
The usual way to give the user a way to select criteria is by unbound
controls on a form. In your case you need a way for the user to select C
and
H. You could use a form named FrmCriteria with two comboboxes named
FirstLetter and LastLetter. Your query then would have the criteria:
Between Forms!FrmCriteria!FirstLetter And Forms!FrmCriteria!LastLetter

You would need to insure that the form was open (perhaps not visible)
when
the report opened so the recordsource query could find the two criteria
fields.

To get "This report contains posts between C and H" in the report header,
all you need is a textbox in the report header with the following
expression
in the control source:
=""This report contains posts between " & Forms!FrmCriteria!FirstLetter &
"
and " & Forms!FrmCriteria!LastLetter

<watch for wrapping>

Steve
(e-mail address removed)







.
 
Leif Thorsen said:
Steve !!

Thank You for Your answer !!
But is there no way to pick up the expressions inside the two (or four
depending how You see it) brackets [ ] within the query instead for
making a
separate form for it ??
The reason for my wish is that I already have a command buttom in form for
"Print me a report" and don´t want to open a new form when I already is
working in one.
--
Thanks in advance for Your help


Steve said:
The usual way to give the user a way to select criteria is by unbound
controls on a form. In your case you need a way for the user to select C
and
H. You could use a form named FrmCriteria with two comboboxes named
FirstLetter and LastLetter. Your query then would have the criteria:
Between Forms!FrmCriteria!FirstLetter And Forms!FrmCriteria!LastLetter

You would need to insure that the form was open (perhaps not visible)
when
the report opened so the recordsource query could find the two criteria
fields.

To get "This report contains posts between C and H" in the report header,
all you need is a textbox in the report header with the following
expression
in the control source:
=""This report contains posts between " & Forms!FrmCriteria!FirstLetter &
"
and " & Forms!FrmCriteria!LastLetter

<watch for wrapping>

Steve
(e-mail address removed)







.
 
Back
Top