Good morning Duane:
The following is the SQL for the Query that makes up my
main report:
SELECT qry_protocols_medicare.Diagnosis,
tbl_protocols_cycle_frequency.Protocols,
tbl_protocols_cycle_frequency.Description,
tbl_protocols_cycle_frequency.[Number of Treatments], Sum
(qry_protocols_medicare!Profit)+Sum
(qry_protocols_medicare![Infusion Profit]) AS [Profit per
Treatment], [Number of Treatments]*[Profit per Treatment]
AS [Profit per Regimen]
FROM (tbl_protocols_cycle_frequency LEFT JOIN
tbl_protocols_detail_hcpcs ON
tbl_protocols_cycle_frequency.Protocols =
tbl_protocols_detail_hcpcs.Protocols) LEFT JOIN
qry_protocols_medicare ON
(tbl_protocols_detail_hcpcs.HCPCS =
qry_protocols_medicare.HCPCS) AND
(tbl_protocols_detail_hcpcs.Protocols =
qry_protocols_medicare.Protocol)
GROUP BY qry_protocols_medicare.Diagnosis,
tbl_protocols_cycle_frequency.Protocols,
tbl_protocols_cycle_frequency.Description,
tbl_protocols_cycle_frequency.[Number of Treatments];
Now, this SQL pertains to the query that makes up my
subreport:
SELECT qry_supp_med.Diseases, qry_supp_med.Protocols,
qry_supp_med.HCPCS, tbl_supportive_drugs.Description,
tbl_supportive_drugs.TYPE, tbl_supportive_drugs.[Number
of Injections], qry_supp_med.PROFIT, [Number of
Injections]*[PROFIT] AS [PROFIT PER REGIMEN]
FROM tbl_supportive_drugs INNER JOIN qry_supp_med ON
(tbl_supportive_drugs.Protocols = qry_supp_med.Protocols)
AND (tbl_supportive_drugs.HCPCS = qry_supp_med.HCPCS)
GROUP BY qry_supp_med.Diseases, qry_supp_med.Protocols,
qry_supp_med.HCPCS, tbl_supportive_drugs.Description,
tbl_supportive_drugs.TYPE, tbl_supportive_drugs.[Number
of Injections], qry_supp_med.PROFIT;
I hope I am right about the common field, which
is "protocols"
What I am trying to show is the pertaining supportive
drugs in my subreport for each protocol in my main
report...I get both in separate queries and I am trying
to put them together in a report, but I selected unbound
when creating it through the wizard and it worked for one
protocol, but if I add another one, then I get the
results below...Then, when I bound the by protocol is
when I have issues also...Each protocol in my main report
will have the same supportive drugs, but different doses..
I hope I have not confused you by now...
Thanks a lot for all of your help...
-----Original Message-----
Apparently Access can't resolve the fields in your subreport or main report.
Can you provide the SQL views of both and the common/join field?
--
Duane Hookom
MS Access MVP
Duane:
I did what you have told me and this is what I get:
"You can't use a pass through query or a non-fixed- colum
crosstab query as a record source for a subform or
subreport.
Before you bind the suform or subreport to a crosstab
query, set the query's ColumnHeadings property."
I subreport comes from a query, but it is not
crosstab...I do not understand what it means about
setting ColumHeadings property. Can you please assit me
on this issue...
-----Original Message-----
I think all you have to do is set the Link Master/Child
properties of the
subreport to your linking field (Contract?).
--
Duane Hookom
MS Access MVP
--
message
Hi:
I have the followinf problem with my report:
Problem:
I have created a report in which I added a subreport.
Well, I created the subreport using the Wixard and
selected "not to bound it"...The problem I have is that
now that I add new data into my subreport it adds it
for
every contract that I have instead of adding only the
we
are suppose to bill each contract...
Example
I get:
Contract LMOBG1022
Code Bill
H305 2
H306 1
H305 5
H306 2
Contract RAMBG0608
Code Bill
H305 2
H306 1
H305 5
H306 2
and I want to obtain:
Contract LMOBG1022
Code Bill
H305 2
H306 1
Contract RAMBG0608
Code Bill
H305 5
H305 2
How do I go back to tell it that Bill Units vary per
contract...I used the wizard to create my subreport and
selected unbound, but now I do not want to recreate the
entire report....
I hope it makes sense what I am asking...
Thank you...
.
.