请问各位朋友,这个程序怎么实现累加
Private Sub command1_Click()
Dim s As String
Dim k As Boolean
k = False
s = "select * from 工资表 where "
If Check1.Value Then
s = s + " 所属工资月份 like '%" + Combo1.Text + "%'"
k = True
End If
If Check2.Value Then
If k Then
s = s + " and 员工编号 like '%" + Text2.Text + "%'"
Else
s = s + " 员工编号 like '%" + Text2.Text + "%'"
End If
End If
If Check3.Value Then
If k Then
s = s + " and 员工姓名 like '%" + Text3.Text + "%'"
Else
s = s + " 员工姓名 like '%" + Text3.Text + "%'"
End If
End If
If Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 0 Then
s = "select * from 工资表 where 1=2"
End If
Adodc1.RecordSource = s
Adodc1.Refresh
End Sub
Private Sub Command2_Click()
Frmgzdyin.Show
End Sub
Private Sub command3_Click()
DE.rs工资表.MovePrevious
If DE.rs工资表.BOF Then
DE.rs工资表.MoveFirst
End If
End Sub
Private Sub Command4_Click()
DE.rs工资表.MoveNext
If DE.rs工资表.EOF Then
DE.rs工资表.MoveLast
End If
End Sub
Private Sub command5_Click()
DE.rs工资表.AddNew
End Sub
Private Sub Command6_Click()
If MsgBox("确实要删除吗?", vbQuestion + vbYesNo, "提示") = vbYes Then
DE.rs合同表.Delete
Command4_Click
End If
End Sub
Private Sub Form_Load()
End Sub