假如有一个事件过程:
Private Sub Command0_Click()
Dim Rec As ADODB.Recordset
dim str
str="SELECT 部门, Sum(效益工资) AS 效益工资之总计, Sum(税) AS 税之总计, Sum(实领工) AS 实领工资之总计 FROM 基础 GROUP BY 部门 "
Set Rec = New ADODB.Recordset
Rec.Open str,CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set Me.Form.Recordset = Rec
End Sub