Calucaltion between two subreports

G

Guest

I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
S

strive4peace

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
G

Guest

I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

strive4peace said:
Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
S

strive4peace

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

strive4peace said:
Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
G

Guest

Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

strive4peace said:
Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

strive4peace said:
Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
S

strive4peace

Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

strive4peace said:
Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
G

Guest

Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
strive4peace said:
Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

strive4peace said:
Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
S

strive4peace

Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
strive4peace said:
Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

:

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
G

Guest

The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


strive4peace said:
Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
strive4peace said:
Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

:

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
S

strive4peace

Hi T-Bird,

thanks, can you email me your database so I can take a look? Please
specify the name of the main report you are working with.

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


strive4peace said:
Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
:

Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

:

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I have a main report with two subreports. The main report and subreport 1
work of the same record source, subrept 2 uses a different record source. All
three are grouped by "DIVISION". On subreport 2 I need to calculate a
precentage (total service fee/total airfare), that requires an amount (total
airfare), from subreport1, this same amount is also in the main report. I
have tried this two different ways and I cannot get the right precentage.
Access appears to be taking each divisions service fee and dividing it by
only one divisions airfare total. PLEASE HELP! Here is a sample of the
espression I created.

Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

Expression using amount from main report:
=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

Please help I have tried this over and over and I can't get it to do each
division individually.
 
G

Guest

I just email the database to you if you have questions you can call me or
emial me back. Thanks so much for your help.

strive4peace said:
Hi T-Bird,

thanks, can you email me your database so I can take a look? Please
specify the name of the main report you are working with.

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


strive4peace said:
Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
:

Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

:

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
 
G

Guest

I recieved an undeliverable message from Microsoft outlook that the database
file is too larg to send now what do I do?

strive4peace said:
Hi T-Bird,

thanks, can you email me your database so I can take a look? Please
specify the name of the main report you are working with.

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


strive4peace said:
Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
:

Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

:

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
 
S

strive4peace

Hi T-Bird,

you can upload it to

YouSendIt.com

it is free ... as long as your db is <100 MB ;)

then just send me the link of where to get it

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I recieved an undeliverable message from Microsoft outlook that the database
file is too larg to send now what do I do?

strive4peace said:
Hi T-Bird,

thanks, can you email me your database so I can take a look? Please
specify the name of the main report you are working with.

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


:

Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
:

Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

:

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
Service Fees]/Reports![Executive Travel Summary YTD].report![Corp Days
Adv], 1)

make sure you are referring to the NAME property of the control and not
the ControlSource...

on this one:
Expression using the Airfare total from Subreport1:
=[Total Service Fees]/Reports![Executive Travel Summary
YTD]!ETLsubrpt1a.Report![Total Amt]

... where is it being used? in subreport2? If so, you can also addrss
subreport1 relatively...

=[Total Service Fees]/parent.ETLsubrpt1a.Report![Total Amt]


If you are interested in some basic info on Access, send me an email and
request my 30-page Word document on Access Basics (for Programming) --
it doesn't cover VBA, but prepares you for it because it covers
essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...


Warm Regards,
Crystal
 
G

Guest

Hi Crystal,

I made a copy and just imported that report and the tables and emaild it
with directions on how to open the report. I'll do the upload as well just
in case.

Thanks,

strive4peace said:
Hi T-Bird,

you can upload it to

YouSendIt.com

it is free ... as long as your db is <100 MB ;)

then just send me the link of where to get it

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I recieved an undeliverable message from Microsoft outlook that the database
file is too larg to send now what do I do?

strive4peace said:
Hi T-Bird,

thanks, can you email me your database so I can take a look? Please
specify the name of the main report you are working with.

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


:

Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
:

Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

:

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
 
S

strive4peace

Hi T-Bird,

Got the database

The reason you can't use the division subtotal from the left subreport
in the right subreport is because you have several lines of division
subtotals and Access does not know which line to get the total from...

So we will make a query that gets the division totals that are reported
on the left subreport and link it to each division in the RecordSource
property of the right subreport.

I made queries from your SQL for the left and the right subreports. To
make the SQL easier to read, I used Aliases for the fieldlists --> ie:
[Air Travel Data] AS A

Name: sub_left

SELECT A.[AIR TRAVEL ID]
, A.DIVISION
, A.[PASSENGER NAME]
, A.[DEPARTMENT NUMBER]
, A.[ISSUE DATE]
, A.[FULL FARE]
, A.[LOW FARE]
, A.[TICKET AMT]
, A.[LOST SAVINGS]
, A.[FARE SAVINGS REASON]
, A.DAYSADV
, A.[TRAVEL PURPOSE]
, A.[AIR TRAVEL ID]
FROM [Air Travel Data] AS A
WHERE (((A.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (A.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date]))
GROUP BY A.[AIR TRAVEL ID]
, A.DIVISION
, A.[PASSENGER NAME]
, A.[DEPARTMENT NUMBER]
, A.[ISSUE DATE]
, A.[FULL FARE]
, A.[LOW FARE]
, A.[TICKET AMT]
, A.[LOST SAVINGS]
, A.[FARE SAVINGS REASON]
, A.DAYSADV
, A.[TRAVEL PURPOSE]
, A.[AIR TRAVEL ID];

Name: sub_right

SELECT SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
FROM [Service Fee Data] AS SF
WHERE (((SF.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (SF.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date])
AND ((SF.SERVICE)<>"CAR/HOTEL SERVICE FEE"))
GROUP BY SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE];

******** make a query to get totals by division

make a query to total the Ticket Amount by Division for the date range
chosen on the report menu

Name: sub_division_totals

SELECT A.DIVISION, Sum(A.[TICKET AMT]) AS [SumOfTICKET AMT]
FROM [Air Travel Data] AS A
WHERE (((A.[ISSUE DATE])>=Forms![View Reports]![Beginning Issue Date]
And (A.[ISSUE DATE])<=Forms![View Reports]![Ending Issue Date]))
GROUP BY A.DIVISION;

In the RecordSource for the subreport on the right, which is where you
want to be able to use the total by division, change the SQL to this:

Name: sub_right

SELECT SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
, T.[SumOfTICKET AMT]
FROM sub_division_totals AS T
INNER JOIN [Service Fee Data] AS SF ON T.DIVISION = SF.DIVISION
WHERE (((SF.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (SF.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date])
AND ((SF.SERVICE)<>"CAR/HOTEL SERVICE FEE"))
GROUP BY SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
, T.[SumOfTICKET AMT];

1. Go to the design view of the subreport on the right

2. Turn on the fieldlist (View, Fieldlist from the menu)
you will now see [SumOfTICKET AMT] as a field

3. drag [SumOfTICKET AMT] to the report layout into the section where
you want to use the number

4. delete the label

5. we do not need this number to show, so set the following properties:
Visible --> No
BackColor --> black
Forecolor --> white

I make invisible controls white on black so that when I go into the
design view, I quickly see my invisible controls

6. change the Name property of the control to remove the space
SumOfTICKET AMT --> SumOfTICKETAMT

7. use the control in an equation

control Name: Service Fee Percentage

ControlSource --> =[Total Service Fees]/[SumOfTICKETAMT]


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Hi Crystal,

I made a copy and just imported that report and the tables and emaild it
with directions on how to open the report. I'll do the upload as well just
in case.

Thanks,

strive4peace said:
Hi T-Bird,

you can upload it to

YouSendIt.com

it is free ... as long as your db is <100 MB ;)

then just send me the link of where to get it

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
I recieved an undeliverable message from Microsoft outlook that the database
file is too larg to send now what do I do?

:

Hi T-Bird,

thanks, can you email me your database so I can take a look? Please
specify the name of the main report you are working with.

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


:

Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Crystal,

"What fields are in Air Travel Data that you are using?"
Division, Days Advance Purchase, Ticket Amount

"What fields are in Service Fee Data that you are using"
Division, Service Fee, Service Provided

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?
I have not created any relationship between the two tables and there is
no link created between the two tables. This is due to the fact that the
Service Fee Data table not only contains data related to Air Travel but it
also contains data related to Car Rental and Hotel Fees. So where one client
can be on one table 1 time during a period the could be on the other 3 times.

How do I set the main table up to link both tables?
:

Hi T-Bird,

"Both subreports are in the report footer of the main report"

that explains why it is pulling the same number -- you only have one
current record on one subform in the section ... if you were in a
division group section and just printing everything for each division
seperately, your equations would work -- which is why they do work for
the last division...

Why not set the main report up to link all the data from both tables,
then use the grouping capability with reports and group the information
by division?

What fields are in Air Travel Data that you are using?

What fields are in Service Fee Data that you are using?

What kind of replationship is between the two tables... one-to-many?
many-to-many? What field(s) is used to link the data?

until I know more about the data, I can't help you with the query either
.... but perhaps that is not the best way to go...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
Both subreports are in the report footer of the main report. There is a table
"Air Travel Data" that feeds the "main report" and "subreport 1a". There is a
table, "Service Fee Data" that feeds subreport 1.

Text boxe controls are set as so:
Total Amt: =Sum([TICKET AMT])
Corp Days Adv: =[Div 21 Day Ticket Price]+[Div14-20 Ticket Price]+[Div 13-
Ticket Price]
Total Service Fees: =Sum([SERVICE FEE])

I hope this answeres your question on the structure. Secondly how do I
create a totals query by division and link to that in the appropriate
recordset
Thanks

:

Hi T-bird,

can you elaborate on the data structures a bit? And also, what sections
of the report your subreports are in and which tables feed the report
and subreports?

Perhaps, instead of using the calculated total from the report, you may
want to use a totals query by division and link to that in the
appropriate recordset

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I apologize, there are a total of 12 divisions, only division #12 has the
correct %, what is happening is that access is taking the service amount of
divisions 1-11 and dividing them all by the airfare of division 12 rather
than by their own division airfare. So it's going like this #1/#12,
#2/#12.....etc, is hould be #1/#1, #2/#2.....etc (service fee/airfare).

This is what should be happening:

Fees / Airfare = Airfare %
$15.00 $150.20 10.0%
$100.00 $7,718.57 1.3%
$230.00 $18,247.06 1.3%
$90.00 $5,207.70 1.7%
$130.00 $10,291.80 1.3%
$330.00 $20,558.39 1.6%
$50.00 $1,007.80 5.0%
$55.00 $3,382.00 1.6%
$4,155.00 $300,255.24 1.4%
$1,402.00 $24,148.34 5.8%
$10.00 $2,737.10 0.4%
$1,835.00 $96,165.07 1.9%

This is what is happening:

Fees / Airfare = Airfare %
$15.00 $96,165.07 0.0%
$100.00 $96,165.07 0.1%
$230.00 $96,165.07 0.2%
$90.00 $96,165.07 0.1%
$130.00 $96,165.07 0.1%
$330.00 $96,165.07 0.3%
$50.00 $96,165.07 0.1%
$55.00 $96,165.07 0.1%
$4,155.00 $96,165.07 4.3%
$1,402.00 $96,165.07 1.5%
$10.00 $96,165.07 0.0%
$1,835.00 $96,165.07 1.9%

I tried both of the suggestions that you provided me and neither of them
worked. I keep getting the wrong % for divisions 1-11. #12 is the only one
that is right. Is it possible that what I am asking is not possible? could I
create a field within the querey to do the calculation then add it to the
subreport? I've run out of ideas and at a loss for what else to try.
Thanks,

:

Hi T-Bird,

you did not say what was working and what was not... but I see a syntax
error

=[Total Service Fees]/Reports![Executive Travel Summary YTD]![Corp Days Adv]

should be

=[Total Service Fees]/Reports![Executive Travel Summary
YTD].report![Corp Days Adv]

also, in case the subreport doesn't have data...

=IIF( Reports![Executive Travel Summary YTD].report.HasData, [Total
 
G

Guest

Thanks so much Crystal this worked like a charm!!!! and it was definately a
lot easier than what I was trying to do.

strive4peace said:
Hi T-Bird,

Got the database

The reason you can't use the division subtotal from the left subreport
in the right subreport is because you have several lines of division
subtotals and Access does not know which line to get the total from...

So we will make a query that gets the division totals that are reported
on the left subreport and link it to each division in the RecordSource
property of the right subreport.

I made queries from your SQL for the left and the right subreports. To
make the SQL easier to read, I used Aliases for the fieldlists --> ie:
[Air Travel Data] AS A

Name: sub_left

SELECT A.[AIR TRAVEL ID]
, A.DIVISION
, A.[PASSENGER NAME]
, A.[DEPARTMENT NUMBER]
, A.[ISSUE DATE]
, A.[FULL FARE]
, A.[LOW FARE]
, A.[TICKET AMT]
, A.[LOST SAVINGS]
, A.[FARE SAVINGS REASON]
, A.DAYSADV
, A.[TRAVEL PURPOSE]
, A.[AIR TRAVEL ID]
FROM [Air Travel Data] AS A
WHERE (((A.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (A.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date]))
GROUP BY A.[AIR TRAVEL ID]
, A.DIVISION
, A.[PASSENGER NAME]
, A.[DEPARTMENT NUMBER]
, A.[ISSUE DATE]
, A.[FULL FARE]
, A.[LOW FARE]
, A.[TICKET AMT]
, A.[LOST SAVINGS]
, A.[FARE SAVINGS REASON]
, A.DAYSADV
, A.[TRAVEL PURPOSE]
, A.[AIR TRAVEL ID];

Name: sub_right

SELECT SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
FROM [Service Fee Data] AS SF
WHERE (((SF.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (SF.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date])
AND ((SF.SERVICE)<>"CAR/HOTEL SERVICE FEE"))
GROUP BY SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE];

******** make a query to get totals by division

make a query to total the Ticket Amount by Division for the date range
chosen on the report menu

Name: sub_division_totals

SELECT A.DIVISION, Sum(A.[TICKET AMT]) AS [SumOfTICKET AMT]
FROM [Air Travel Data] AS A
WHERE (((A.[ISSUE DATE])>=Forms![View Reports]![Beginning Issue Date]
And (A.[ISSUE DATE])<=Forms![View Reports]![Ending Issue Date]))
GROUP BY A.DIVISION;

In the RecordSource for the subreport on the right, which is where you
want to be able to use the total by division, change the SQL to this:

Name: sub_right

SELECT SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
, T.[SumOfTICKET AMT]
FROM sub_division_totals AS T
INNER JOIN [Service Fee Data] AS SF ON T.DIVISION = SF.DIVISION
WHERE (((SF.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (SF.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date])
AND ((SF.SERVICE)<>"CAR/HOTEL SERVICE FEE"))
GROUP BY SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
, T.[SumOfTICKET AMT];

1. Go to the design view of the subreport on the right

2. Turn on the fieldlist (View, Fieldlist from the menu)
you will now see [SumOfTICKET AMT] as a field

3. drag [SumOfTICKET AMT] to the report layout into the section where
you want to use the number

4. delete the label

5. we do not need this number to show, so set the following properties:
Visible --> No
BackColor --> black
Forecolor --> white

I make invisible controls white on black so that when I go into the
design view, I quickly see my invisible controls

6. change the Name property of the control to remove the space
SumOfTICKET AMT --> SumOfTICKETAMT

7. use the control in an equation

control Name: Service Fee Percentage

ControlSource --> =[Total Service Fees]/[SumOfTICKETAMT]


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Hi Crystal,

I made a copy and just imported that report and the tables and emaild it
with directions on how to open the report. I'll do the upload as well just
in case.

Thanks,

strive4peace said:
Hi T-Bird,

you can upload it to

YouSendIt.com

it is free ... as long as your db is <100 MB ;)

then just send me the link of where to get it

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I recieved an undeliverable message from Microsoft outlook that the database
file is too larg to send now what do I do?

:

Hi T-Bird,

thanks, can you email me your database so I can take a look? Please
specify the name of the main report you are working with.

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


:

Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
 
S

strive4peace

you're welcome, T-Bird ;) happy to help

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Thanks so much Crystal this worked like a charm!!!! and it was definately a
lot easier than what I was trying to do.

strive4peace said:
Hi T-Bird,

Got the database

The reason you can't use the division subtotal from the left subreport
in the right subreport is because you have several lines of division
subtotals and Access does not know which line to get the total from...

So we will make a query that gets the division totals that are reported
on the left subreport and link it to each division in the RecordSource
property of the right subreport.

I made queries from your SQL for the left and the right subreports. To
make the SQL easier to read, I used Aliases for the fieldlists --> ie:
[Air Travel Data] AS A

Name: sub_left

SELECT A.[AIR TRAVEL ID]
, A.DIVISION
, A.[PASSENGER NAME]
, A.[DEPARTMENT NUMBER]
, A.[ISSUE DATE]
, A.[FULL FARE]
, A.[LOW FARE]
, A.[TICKET AMT]
, A.[LOST SAVINGS]
, A.[FARE SAVINGS REASON]
, A.DAYSADV
, A.[TRAVEL PURPOSE]
, A.[AIR TRAVEL ID]
FROM [Air Travel Data] AS A
WHERE (((A.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (A.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date]))
GROUP BY A.[AIR TRAVEL ID]
, A.DIVISION
, A.[PASSENGER NAME]
, A.[DEPARTMENT NUMBER]
, A.[ISSUE DATE]
, A.[FULL FARE]
, A.[LOW FARE]
, A.[TICKET AMT]
, A.[LOST SAVINGS]
, A.[FARE SAVINGS REASON]
, A.DAYSADV
, A.[TRAVEL PURPOSE]
, A.[AIR TRAVEL ID];

Name: sub_right

SELECT SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
FROM [Service Fee Data] AS SF
WHERE (((SF.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (SF.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date])
AND ((SF.SERVICE)<>"CAR/HOTEL SERVICE FEE"))
GROUP BY SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE];

******** make a query to get totals by division

make a query to total the Ticket Amount by Division for the date range
chosen on the report menu

Name: sub_division_totals

SELECT A.DIVISION, Sum(A.[TICKET AMT]) AS [SumOfTICKET AMT]
FROM [Air Travel Data] AS A
WHERE (((A.[ISSUE DATE])>=Forms![View Reports]![Beginning Issue Date]
And (A.[ISSUE DATE])<=Forms![View Reports]![Ending Issue Date]))
GROUP BY A.DIVISION;

In the RecordSource for the subreport on the right, which is where you
want to be able to use the total by division, change the SQL to this:

Name: sub_right

SELECT SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
, T.[SumOfTICKET AMT]
FROM sub_division_totals AS T
INNER JOIN [Service Fee Data] AS SF ON T.DIVISION = SF.DIVISION
WHERE (((SF.[ISSUE DATE])>=[Forms]![View Reports]![Beginning Issue Date]
And (SF.[ISSUE DATE])<=[Forms]![View Reports]![Ending Issue Date])
AND ((SF.SERVICE)<>"CAR/HOTEL SERVICE FEE"))
GROUP BY SF.[SERVICE FEE ID]
, SF.[PASSENGER NAME]
, SF.[ISSUE DATE]
, SF.SERVICE
, SF.[SERVICE FEE]
, SF.DIVISION
, SF.DEPARTMENT
, SF.[EMPLOYEE ID]
, SF.[TRAVEL PURPOSE]
, T.[SumOfTICKET AMT];

1. Go to the design view of the subreport on the right

2. Turn on the fieldlist (View, Fieldlist from the menu)
you will now see [SumOfTICKET AMT] as a field

3. drag [SumOfTICKET AMT] to the report layout into the section where
you want to use the number

4. delete the label

5. we do not need this number to show, so set the following properties:
Visible --> No
BackColor --> black
Forecolor --> white

I make invisible controls white on black so that when I go into the
design view, I quickly see my invisible controls

6. change the Name property of the control to remove the space
SumOfTICKET AMT --> SumOfTICKETAMT

7. use the control in an equation

control Name: Service Fee Percentage

ControlSource --> =[Total Service Fees]/[SumOfTICKETAMT]


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird said:
Hi Crystal,

I made a copy and just imported that report and the tables and emaild it
with directions on how to open the report. I'll do the upload as well just
in case.

Thanks,

:

Hi T-Bird,

you can upload it to

YouSendIt.com

it is free ... as long as your db is <100 MB ;)

then just send me the link of where to get it

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
I recieved an undeliverable message from Microsoft outlook that the database
file is too larg to send now what do I do?

:

Hi T-Bird,

thanks, can you email me your database so I can take a look? Please
specify the name of the main report you are working with.

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



T-bird wrote:
The "Service" column of the "Service Fee Data Table" is a dollar amount. The
actual "Air Travel Fare" is in the "Air Trave Data Table" it is in the
"Ticket Amnt" column and also is a dollar amount. The division field of both
tables is similar however, for each passenger that shows up in thier division
on the "Air Travel Data" tabel they could show up multiple times on the
"Service Fee Data" table, if the purchase air and hotel services during the
time period. We do not match the service fee to the individual ticket we do
them on a whole by division. so for div #1 the had $15 in serivice fees and
theeir were airline tickets purchsed by div #1 in the sum of $150.20.

The SQL statement for the main report is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[TICKET AMT], [Air Travel
Data].[FULL FARE], [Air Travel Data].[LOW FARE], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE];

The SQL statement for Subreport1a is:
SELECT [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID]
FROM [Air Travel Data]
WHERE ((([Air Travel Data].[ISSUE DATE])>=[Forms]![View Reports]![Beginning
Issue Date] And ([Air Travel Data].[ISSUE DATE])<=[Forms]![View
Reports]![Ending Issue Date]))
GROUP BY [Air Travel Data].[AIR TRAVEL ID], [Air Travel Data].DIVISION, [Air
Travel Data].[PASSENGER NAME], [Air Travel Data].[DEPARTMENT NUMBER], [Air
Travel Data].[ISSUE DATE], [Air Travel Data].[FULL FARE], [Air Travel
Data].[LOW FARE], [Air Travel Data].[TICKET AMT], [Air Travel Data].[LOST
SAVINGS], [Air Travel Data].[FARE SAVINGS REASON], [Air Travel Data].DAYSADV,
[Air Travel Data].[TRAVEL PURPOSE], [Air Travel Data].[AIR TRAVEL ID];

The SQL Statement for Subreport1 is:
SELECT [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
FROM [Service Fee Data]
GROUP BY [Service Fee Data].[SERVICE FEE ID], [Service Fee Data].[PASSENGER
NAME], [Service Fee Data].[ISSUE DATE], [Service Fee Data].SERVICE, [Service
Fee Data].[SERVICE FEE], [Service Fee Data].DIVISION, [Service Fee
Data].DEPARTMENT, [Service Fee Data].[EMPLOYEE ID], [Service Fee
Data].[TRAVEL PURPOSE]
HAVING ((([Service Fee Data].[ISSUE DATE])>=[Forms]![View
Reports]![Beginning Issue Date] And ([Service Fee Data].[ISSUE
DATE])<=[Forms]![View Reports]![Ending Issue Date]) AND (([Service Fee
Data].SERVICE)<>"CAR/HOTEL SERVICE FEE"));


:

Hi T-Bird,

Division looks a common field... that could be linked

Which field in Service Fee Data table denotes an Air Travel fare?
Service Provided? If so, what are the values in that field? If not,
how do you match a service fee to a ticket?

What is the SQL for RecordSources for each report/subreport?

send me an email and request my 30-page Word document on Access Basics
(for Programming) -- it doesn't cover VBA, but prepares you for it
because it covers essentials in Access.

Be sure to put at least "Access Basics" in the subject line so that I
see your message...

Warm Regards,
Crystal
*
 

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