subtotal on only one item

L

lake2212

I have a table with Stockname, Symbol, SecurityType, OptionDate,
OptionStrikePrice, OptionDesc(which is OptionDate and OptionStrikePrice
concatenated), Sharesbought, Sharessold, Number of Shares(which is Sum of
Sharesbought and Sharessold). Would it be possible to subtotal only the
"Stock" SecurityType, and only show the subtotal for that SecurityType(no
detail records), then go on to list the other records without subtotals?
(Records with the SecurityType "Stock" will not ever have an "OptionDesc".

Example - Here would be sample data:

Stock name Symbol Security Type Option Desc Number of Shares
American Exp AXP Stock 500
American Exp AXP Stock 200
American Exp AXP Stock 25
American Exp AXP Call Jan-10-20 -15
American Exp AXP Put Apr-09-25.5 20
American Exp AXP Call Jan-11-50 -35

Can I get the report to look like this:

Stock Name Symbol Sec Type Desc #Shares
American Exp AXP Stock 725 (this is the
subtotal)
Call Jan-10-20 -15
Put Apr-09-25.5 20
Call Jan-11-50 -35

Thanks for your help.
Julie
 
J

John W. Vinson/MVP

I have a table with Stockname, Symbol, SecurityType, OptionDate,
OptionStrikePrice, OptionDesc(which is OptionDate and OptionStrikePrice
concatenated), Sharesbought, Sharessold, Number of Shares(which is Sum of
Sharesbought and Sharessold). Would it be possible to subtotal only the
"Stock" SecurityType, and only show the subtotal for that SecurityType(no
detail records), then go on to list the other records without subtotals?
(Records with the SecurityType "Stock" will not ever have an "OptionDesc".

Not in a Query - queries need to be "homogenous", with all records
having the same "shape". But you could use the Sorting and Grouping
dialog of a Report to do this; just group by security type and put the
totals in the section footers as appropriate.
 
L

lake2212

Thanks, I got the subtotal to work. But is there a way to supress the
records of SECTYPE "Stock" and only print that subtotal? Then continue on to
print the other records of other SECTYPEs?
 
J

John W. Vinson/MVP

Thanks, I got the subtotal to work. But is there a way to supress the
records of SECTYPE "Stock" and only print that subtotal? Then continue on to
print the other records of other SECTYPEs?

You may need an unbound Report with two Subreports. You're getting a
bit beyond my expertise in the (sometimes rather arcane) field of
report formatting - you might try reposting a description of the
problem in the Reports newsgroup, rather than Getting Started.
 
L

lake2212

Okay, thanks for your help.

John W. Vinson/MVP said:
You may need an unbound Report with two Subreports. You're getting a
bit beyond my expertise in the (sometimes rather arcane) field of
report formatting - you might try reposting a description of the
problem in the Reports newsgroup, rather than Getting Started.
 
K

Ken Sheridan

Julie:

Try this:

1. In the report's detail section's Format event procedure put:

Cancel = (Me.SecurityType = "Stock")

2. In the group footer's Format even procedure out:

Cancel = (Me.SecurityType <> "Stock")

Note that SecurityType must be the name of the control bound to the
SecurityType column. Unlike in forms, in a report you cannot refer directly
in a report's module to a column in the underlying recordset.

Ken Sheridan
Stafford, England
 

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