Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting a total into a Datagrid when data changes

Status
Not open for further replies.

fareezf

Programmer
Oct 26, 2003
20
CA
Hi,

I am using MsAccess 2000 and VB6 to display records from a table named 'CustomerOrders' in which there are 4 fields namely 'Style','Colour', 'OrderQty' and 'OrderSize'.

I'm using a Datagrid connected to a Adodc to display the records in the following manner.

STYLE COLOUR ORDERQTY ORDERSIZE
01 Blue 10 2
01 Blue 02 3
02 Blue 30 2
02 Green 40 4

Could somebody help me to do the following?

1. If the data is the same it should be left blank (e.g. instead of showing Blue 3 times once is enough followed by green).

2. How do I show a total field when the data for colour changes? (That is after the blue I need to show total = 42 and after green the total = 40 and so on..)

Any help will be much appreciated even if I have to use another method or control please let me know. I have spent more than two days in pulling my hair that I'm on the verge of looking like yul briner.
 
1. Read faq222-2244 to find out about asking the same question in different threads

2. Read faq222-2244 to find out about acknowledging answers given

3. Try using a MSHFlexGrid control. You will then have full control over the individual cells, as you don't need to be bound to a datacontrol. If you load record by record in code, just check the appropriate cell in the previos row

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top