algebric summ with a pair of values

User avatar
sal21
PlatinumLounger
Posts: 4343
Joined: 26 Apr 2010, 17:36

algebric summ with a pair of values

Post by sal21 »

I use ado and vb6 classic and access database...

in table have:

Field1 Field2 Field3
AAA BBB -100
AAA CCC 100
AAA BBB 100
AAA BBB 100
.....

based the goup by Field1 and Field2 i need to delete a pair of recorset where the algebric summ of filed3 is =0

in this my case delete this two recordset:
AAA BBB -100
AAA BBB 100

to the and of query i need to have this result:

AAA CCC 100
AAA BBB 100

i hope understand me....

Tks.

User avatar
sal21
PlatinumLounger
Posts: 4343
Joined: 26 Apr 2010, 17:36

Re: algebric summ with a pair of values

Post by sal21 »

sal21 wrote:I use ado and vb6 classic and access database...

in table have:

Field1 Field2 Field3
AAA BBB -100
AAA CCC 100
AAA BBB 100
AAA BBB 100
.....

based the goup by Field1 and Field2 i need to delete a pair of recorset where the algebric summ of filed3 is =0

in this my case delete this two recordset:
AAA BBB -100
AAA BBB 100

to the and of query i need to have this result:

AAA CCC 100
AAA BBB 100

i hope understand me....

Tks.
sorry for up

User avatar
HansV
Administrator
Posts: 78393
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: algebric summ with a pair of values

Post by HansV »

Does the table have a primary key, for example an AutoNumber field?
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78393
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: algebric summ with a pair of values

Post by HansV »

If there is a primary key, I know how to do this in Access itself, using queries, but not using VBA.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4343
Joined: 26 Apr 2010, 17:36

Re: algebric summ with a pair of values

Post by sal21 »

HansV wrote:Does the table have a primary key, for example an AutoNumber field?
no. :sad:

User avatar
HansV
Administrator
Posts: 78393
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: algebric summ with a pair of values

Post by HansV »

I'm afraid I don't know a solution.
Best wishes,
Hans