沈 阳 大 学
课程设计说明书 NO.22
Dim mblchange As Boolean
Public txtSQL As String
Public msgtext As String
Dim mrc As ADODB.Recordset
Private Sub cmdcancle_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim intCount As Integer
Dim txtSQL As String
Dim MsgString As String
Dim sMeg As String
Dim i As Integer
For intCount = 0 To 1
If Trim(Text1(intCount) & "") = "" Then
Select Case intCount
Case 0
sMeg = "工号"
Case 1
sMeg = "姓名"
End Select
sMeg = sMeg & "不能为空"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
Text1(intCount).SetFocus
Exit Sub
End If
Next intCount
If Trim(Text1(3) & "") = "" Then
MsgBox "出生日期不能为空", vbOKOnly + vbExclamation, "警告"
End If
If Trim(Text1(3) & "") <> "" Then
If Not IsDate(Text1(3)) Then
MsgBox "出生日期应为(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text1(3).SetFocus
Exit Sub
Else
Text1(3) = Format(Text1(3), "yyyy-mm-dd")
End If
End If
If Trim(Text1(2) & "") = "" Then
MsgBox "年龄不能为空", vbOKOnly + vbExclamation, "警告"
沈 阳 大 学
课程设计说明书 NO.23
Exit Sub
End If
If gintMode = 1 Then
txtSQL = "select * from dangan where ygid='" & Trim(Text1(0)) & "'"
Set mrc = ExecuteSQL(txtSQL, msgtext)
If mrc.EOF = False Then
MsgBox "有重复记录", vbOKOnly + vbExclamation, "警告"
Text1(0).SetFocus
End If
mrc.Close
txtSQL = "delete * from dangan where ygid='" & Trim(Text1(0)) & "'"
Set mrc = ExecuteSQL(txtSQL, msgtext)
txtSQL = "select * from dangan"
Set mrc = ExecuteSQL(txtSQL, msgtext)
mrc.AddNew
For intCount = 0 To 1
mrc.Fields(intCount) = Trim(Text1(intCount))
Next intCount
For intCount = 2 To 5
mrc.Fields(intCount) = Trim(Text1(intCount))
Next intCount
For intCount = 6 To 10
mrc.Fields(intCount) = Trim(Text1(intCount))
Next intCount
mrc.Fields(11) = Trim(Combo1.Text)
mrc.Update
If gintMode = 1 Then
MsgBox "添加记录成功", vbOKOnly, "提示"
For i = 0 To 10
Text1(i).Text = ""
Next i
frmyuangong.Show
frmyuangong.ZOrder 0
frmmanrecord.ShowTitle
frmmanrecord.ShowData
frmmanrecord.ZOrder 1
End If
Private Sub cmdSave_Click()
Dim intCount As Integer
Dim sMeg As String
Dim rectemp As Recordset
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页