'到这里就告一段落了,是不是很简单呢,当然这里有很多不足,你自己完善吧 Private Sub Form_Load()
End Sub
3.4.4退出
选择“系统”->“退出”菜单,单击则推出主菜单界面。
3.4.5基本工资
选择“设置”->“基本工资”菜单,可以单击“添加”,“删除”,“修改
”,“
取
消
”
按
钮
来
实
现
相
应
功
能
。
Dim objrs As ADODB.Recordset Dim msg_sql As String
Private Sub cmd_add_Click() If Combo_level.Text <> \
Set objrs = ExecuteSQL(\基本工资 values(\(Text_pay.Text) + \ '插入符合条件的工资信息
Set objrs = ExecuteSQL(\基本工资\ Set DataGrid1.DataSource = objrs '刷新网格,显示操作后的结果 Combo_level.SetFocus Combo_level.Text = \ Text_pay.Text = \ End If End Sub
Private Sub cmd_cancel_Click() Unload Me End Sub
Private Sub cmd_delete_Click() If objrs.RecordCount = 0 Then MsgBox \库中没有记录!\ Exit Sub End If
If objrs.RecordCount <> 0 Then
If MsgBox(\真的要删除该级别工资信息吗?\vbYesNo + vbQuestion, \警告\= vbYes Then
objrs.Delete
MsgBox \删除成功!\提示\ Combo_level.SetFocus Combo_level.Text = \ Text_pay.Text = \ End If End If End Sub
Private Sub Form_Load()
Set objrs = ExecuteSQL(\基本工资\Set DataGrid1.DataSource = objrs End Sub
Private Sub Text_pay_LostFocus()
If Val(Text_pay.Text) < 0 Or Val(Text_pay.Text) >= 10000 Then MsgBox \数据非法\ Text_pay.Text = \ Text_pay.SetFocus End If End Sub
3.4.6岗位工资
选择“设置”->“岗位工资”菜单,可以单击“添加”,“删除”,“修改
”,“
取
消
”
按
钮
来
实
现
相
应
功
能
。
Dim objrs As ADODB.Recordset Dim msg_sql As String
Private Sub cmd_add_Click() If Combo_level.Text <> \
Set objrs = ExecuteSQL(\岗位工资 values(\(Text_pay.Text) + \ '插入符合条件的工资信息
Set objrs = ExecuteSQL(\岗位工资\ Set DataGrid1.DataSource = objrs '刷新网格,显示操作后的结果 Combo_level.SetFocus Combo_level.Text = \ Text_pay.Text = \ End If End Sub
Private Sub cmd_cancel_Click() Unload Me End Sub
Private Sub cmd_delete_Click() If objrs.RecordCount = 0 Then
MsgBox \库中没有记录!\ Exit Sub End If
If objrs.RecordCount <> 0 Then
If MsgBox(\真的要删除该级别工资信息吗?\vbYesNo + vbQuestion, \警告\= vbYes Then
objrs.Delete
MsgBox \删除成功!\提示\ Combo_level.SetFocus Combo_level.Text = \ Text_pay.Text = \ End If End If End Sub
Private Sub Form_Load()
Set objrs = ExecuteSQL(\岗位工资\Set DataGrid1.DataSource = objrs End Sub
Private Sub Text_pay_LostFocus()
If Val(Text_pay.Text) < 0 Or Val(Text_pay.Text) >= 10000 Then MsgBox \数据非法\ Text_pay.Text = \ Text_pay.SetFocus End If End Sub
3.4.7部门管理
选择“信息维护”->“部门管理”菜单,可以单击“添加”,“删除”,“修改”,“取消”按钮来实现相应功能。