Report w/2 subreports not correctly reading combo box selection in

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

Guest

I have a form that uses a combo box with union query behind it to allow for
the "all" option in choosing what report to load. The whole thing works fine
when I use only 1 report, but when I have the form and its combo box
selection go to a report that carries 2 reports it does not transfer the
selection that was made in the combo box. Both forms use the same answer
from the box as far as what criteria of data to pull. Have tried so many
different ways. but it will still not work with the subreports.
 
This doesn't make much sense to me "report that carries 2 reports it does
not transfer the selection that was made in the combo box". What is a report
that carries 2 reports? Is this a report with two subreports?

How is the combo box used? Does it filter the records in the report(s)
record sources?
 
Let me try again.. I have a form that uses a combo box (which is based on a
union query so I can have the 'all' option show). The report prints records
based on the selection in the combo box. (the report lists and groups all
accounts that are 30, 60, 90, 120 days old) And the combo box tells the
report which manufacturer to pull this data for. With the 'all' option I can
pull the data from 'all' the companies, or I can select a specific company
and pull the data..This works fine if I use one report. But I really need to
be using 2 reports that print as one , i.e. subreports. The 120 days aged
data needs to be in a separate report that does not group the same way the
30,60,90 days group. When I put the 2 reports into a main report, as 2
subreports, than the reports do not seem to be responding to the selection I
made in the combo box. They just give me 'all' the companies.
Thank you,,
 
How is the combo box used to filter the records in the reports/subreports?
Is it used directly in the record source or do you use it as the Where
clause in the DoCmd.OpenReport method. I believe it will only work in the
record source, not in the where clause.
 
Okay... Yes it is currently in the code (cmbGroupName) which is:
========
If Me.cmbGroupName.Value = "All" Then
strProcessedWhere = ""
strDepositWhere = ""
strAnd = ""
End If

strDeposit = strDepositWhere & strAnd & strDepositDate
strProcessed = strProcessedWhere & strAnd & strProcessedDate

If strIdentifier = "1" Then
strReportName = "Processed without DepositNEW"
Me.txtWhere = strProcessed
DoCmd.OpenReport "Processed without DepositNEW", acViewPreview, ,
strProcessed
End If

==But when I try to put the the [cmbGroupName] as the record source in the
report itself, then it gives me the actuall word "all" for each of the
company names.
===============
 
Or sometimes it just gives me an error in the field and shows All groups.

moonrise said:
Okay... Yes it is currently in the code (cmbGroupName) which is:
========
If Me.cmbGroupName.Value = "All" Then
strProcessedWhere = ""
strDepositWhere = ""
strAnd = ""
End If

strDeposit = strDepositWhere & strAnd & strDepositDate
strProcessed = strProcessedWhere & strAnd & strProcessedDate

If strIdentifier = "1" Then
strReportName = "Processed without DepositNEW"
Me.txtWhere = strProcessed
DoCmd.OpenReport "Processed without DepositNEW", acViewPreview, ,
strProcessed
End If

==But when I try to put the the [cmbGroupName] as the record source in the
report itself, then it gives me the actuall word "all" for each of the
company names.
===============

Duane Hookom said:
How is the combo box used to filter the records in the reports/subreports?
Is it used directly in the record source or do you use it as the Where
clause in the DoCmd.OpenReport method. I believe it will only work in the
record source, not in the where clause.
 
You can switch "*" for "All" and use
Like Forms!frmYourForm!cmbGroupName
in the sql.

--
Duane Hookom
MS Access MVP
--

moonrise said:
Or sometimes it just gives me an error in the field and shows All groups.

moonrise said:
Okay... Yes it is currently in the code (cmbGroupName) which is:
========
If Me.cmbGroupName.Value = "All" Then
strProcessedWhere = ""
strDepositWhere = ""
strAnd = ""
End If

strDeposit = strDepositWhere & strAnd & strDepositDate
strProcessed = strProcessedWhere & strAnd & strProcessedDate

If strIdentifier = "1" Then
strReportName = "Processed without DepositNEW"
Me.txtWhere = strProcessed
DoCmd.OpenReport "Processed without DepositNEW", acViewPreview, ,
strProcessed
End If

==But when I try to put the the [cmbGroupName] as the record source in
the
report itself, then it gives me the actuall word "all" for each of the
company names.
===============

Duane Hookom said:
How is the combo box used to filter the records in the
reports/subreports?
Is it used directly in the record source or do you use it as the Where
clause in the DoCmd.OpenReport method. I believe it will only work in
the
record source, not in the where clause.

--
Duane Hookom
MS Access MVP
--

Let me try again.. I have a form that uses a combo box (which is
based on
a
union query so I can have the 'all' option show). The report prints
records
based on the selection in the combo box. (the report lists and
groups
all
accounts that are 30, 60, 90, 120 days old) And the combo box tells
the
report which manufacturer to pull this data for. With the 'all'
option I
can
pull the data from 'all' the companies, or I can select a specific
company
and pull the data..This works fine if I use one report. But I really
need
to
be using 2 reports that print as one , i.e. subreports. The 120 days
aged
data needs to be in a separate report that does not group the same
way the
30,60,90 days group. When I put the 2 reports into a main report, as
2
subreports, than the reports do not seem to be responding to the
selection
I
made in the combo box. They just give me 'all' the companies.
Thank you,,

:

This doesn't make much sense to me "report that carries 2 reports it
does
not transfer the selection that was made in the combo box". What is
a
report
that carries 2 reports? Is this a report with two subreports?

How is the combo box used? Does it filter the records in the
report(s)
record sources?

--
Duane Hookom
MS Access MVP


I have a form that uses a combo box with union query behind it to
allow
for
the "all" option in choosing what report to load. The whole thing
works
fine
when I use only 1 report, but when I have the form and its combo
box
selection go to a report that carries 2 reports it does not
transfer
the
selection that was made in the combo box. Both forms use the same
answer
from the box as far as what criteria of data to pull. Have tried
so
many
different ways. but it will still not work with the subreports.
 
I'm sorry Duane,
I don't quite understand where I am putting this statement? The form's
procedure code, on the report somewhere? Currently the all in the union
query is below even the 2 queries that generate the report. That is the only
'sql' in all this This union query currently is:

SELECT "All"
from Bank UNION Select Bank.BankAcct_Name
FROM Bank
GROUP BY Bank.BankAcct_Name;

Sorry for for ignorance. Please be patient and keep helping.
Thank you,
Moonrise

Duane Hookom said:
You can switch "*" for "All" and use
Like Forms!frmYourForm!cmbGroupName
in the sql.

--
Duane Hookom
MS Access MVP
--

moonrise said:
Or sometimes it just gives me an error in the field and shows All groups.

moonrise said:
Okay... Yes it is currently in the code (cmbGroupName) which is:
========
If Me.cmbGroupName.Value = "All" Then
strProcessedWhere = ""
strDepositWhere = ""
strAnd = ""
End If

strDeposit = strDepositWhere & strAnd & strDepositDate
strProcessed = strProcessedWhere & strAnd & strProcessedDate

If strIdentifier = "1" Then
strReportName = "Processed without DepositNEW"
Me.txtWhere = strProcessed
DoCmd.OpenReport "Processed without DepositNEW", acViewPreview, ,
strProcessed
End If

==But when I try to put the the [cmbGroupName] as the record source in
the
report itself, then it gives me the actuall word "all" for each of the
company names.
===============

:

How is the combo box used to filter the records in the
reports/subreports?
Is it used directly in the record source or do you use it as the Where
clause in the DoCmd.OpenReport method. I believe it will only work in
the
record source, not in the where clause.

--
Duane Hookom
MS Access MVP
--

Let me try again.. I have a form that uses a combo box (which is
based on
a
union query so I can have the 'all' option show). The report prints
records
based on the selection in the combo box. (the report lists and
groups
all
accounts that are 30, 60, 90, 120 days old) And the combo box tells
the
report which manufacturer to pull this data for. With the 'all'
option I
can
pull the data from 'all' the companies, or I can select a specific
company
and pull the data..This works fine if I use one report. But I really
need
to
be using 2 reports that print as one , i.e. subreports. The 120 days
aged
data needs to be in a separate report that does not group the same
way the
30,60,90 days group. When I put the 2 reports into a main report, as
2
subreports, than the reports do not seem to be responding to the
selection
I
made in the combo box. They just give me 'all' the companies.
Thank you,,

:

This doesn't make much sense to me "report that carries 2 reports it
does
not transfer the selection that was made in the combo box". What is
a
report
that carries 2 reports? Is this a report with two subreports?

How is the combo box used? Does it filter the records in the
report(s)
record sources?

--
Duane Hookom
MS Access MVP


I have a form that uses a combo box with union query behind it to
allow
for
the "all" option in choosing what report to load. The whole thing
works
fine
when I use only 1 report, but when I have the form and its combo
box
selection go to a report that carries 2 reports it does not
transfer
the
selection that was made in the combo box. Both forms use the same
answer
from the box as far as what criteria of data to pull. Have tried
so
many
different ways. but it will still not work with the subreports.
 
You would use criteria in the reports' record sources like
Like IIf(Forms!frmYourForm!cmbGroupName="All","*"
,Forms!frmYourForm!cmbGroupName)

--
Duane Hookom
MS Access MVP
--

moonrise said:
I'm sorry Duane,
I don't quite understand where I am putting this statement? The form's
procedure code, on the report somewhere? Currently the all in the union
query is below even the 2 queries that generate the report. That is the
only
'sql' in all this This union query currently is:

SELECT "All"
from Bank UNION Select Bank.BankAcct_Name
FROM Bank
GROUP BY Bank.BankAcct_Name;

Sorry for for ignorance. Please be patient and keep helping.
Thank you,
Moonrise

Duane Hookom said:
You can switch "*" for "All" and use
Like Forms!frmYourForm!cmbGroupName
in the sql.

--
Duane Hookom
MS Access MVP
--

moonrise said:
Or sometimes it just gives me an error in the field and shows All
groups.

:

Okay... Yes it is currently in the code (cmbGroupName) which is:
========
If Me.cmbGroupName.Value = "All" Then
strProcessedWhere = ""
strDepositWhere = ""
strAnd = ""
End If

strDeposit = strDepositWhere & strAnd & strDepositDate
strProcessed = strProcessedWhere & strAnd & strProcessedDate

If strIdentifier = "1" Then
strReportName = "Processed without DepositNEW"
Me.txtWhere = strProcessed
DoCmd.OpenReport "Processed without DepositNEW",
acViewPreview, ,
strProcessed
End If

==But when I try to put the the [cmbGroupName] as the record source in
the
report itself, then it gives me the actuall word "all" for each of the
company names.
===============

:

How is the combo box used to filter the records in the
reports/subreports?
Is it used directly in the record source or do you use it as the
Where
clause in the DoCmd.OpenReport method. I believe it will only work
in
the
record source, not in the where clause.

--
Duane Hookom
MS Access MVP
--

Let me try again.. I have a form that uses a combo box (which is
based on
a
union query so I can have the 'all' option show). The report
prints
records
based on the selection in the combo box. (the report lists and
groups
all
accounts that are 30, 60, 90, 120 days old) And the combo box
tells
the
report which manufacturer to pull this data for. With the 'all'
option I
can
pull the data from 'all' the companies, or I can select a specific
company
and pull the data..This works fine if I use one report. But I
really
need
to
be using 2 reports that print as one , i.e. subreports. The 120
days
aged
data needs to be in a separate report that does not group the same
way the
30,60,90 days group. When I put the 2 reports into a main report,
as
2
subreports, than the reports do not seem to be responding to the
selection
I
made in the combo box. They just give me 'all' the companies.
Thank you,,

:

This doesn't make much sense to me "report that carries 2 reports
it
does
not transfer the selection that was made in the combo box". What
is
a
report
that carries 2 reports? Is this a report with two subreports?

How is the combo box used? Does it filter the records in the
report(s)
record sources?

--
Duane Hookom
MS Access MVP


I have a form that uses a combo box with union query behind it
to
allow
for
the "all" option in choosing what report to load. The whole
thing
works
fine
when I use only 1 report, but when I have the form and its
combo
box
selection go to a report that carries 2 reports it does not
transfer
the
selection that was made in the combo box. Both forms use the
same
answer
from the box as far as what criteria of data to pull. Have
tried
so
many
different ways. but it will still not work with the
subreports.
 
Back
Top