rivateSubCommand1_Click()DimsumAsDouble'sum就是所有的和sum=0'先给赋值为0Adodc1.Recordset.MoveFirstDoWhileNotAdodc1.Recordset.EOF'从开始一直到结尾,累加sum=sum+Adodc1.Recordset.Fields("材料成本")Adodc1.Recordset.MoveNextLoopText1.Text=Str(sum)'保存到text1中去Adodc1.Records