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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help in vb and access

Status
Not open for further replies.

m4dd0g

Programmer
Nov 15, 2005
40
0
0
ZA
OK i've created my database and in my table called "Table1"
i've got the entries of all my data which i imported from and excel sheet but now i've got data entries with the same name like this 0000P,LP Gas,9,6.1,8.9 which i need all of those entries add up and put in a table called "Table2" where only one line contains that data with the totals
 
what data access technology are you using? ADO or DAO?
do you mean that you want to put the data into table2 with no duplicates??


if you are using ADO then this is the code: Assume that you have a connection variable nameD dbConnection and your Table2 has the same structure as table 1.

Private sub EleminateDuplicate()
dim strSQL as string

'---select the unique records and insert into table2--
strSQL = "INSERT INTO TABLE2 (select distinct * from table1)
dbconnection.execute strsql

end sub

i hope this helps
 
Please give a better example of what you want to do and a few more records.

Uncle Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top