【正文】
在界面中輸入需要添加的內(nèi)容,接。 Set mrcc = ExecuteSQL(txtSQL, MsgText) If = False Then MsgBox 編號重復(fù),請重新輸入! , vbOKOnly + vbExclamation, 警告 Else (0) = Trim() (1) = Trim() (2) = Trim() (3) = Trim() (4) = Trim() (5) = Trim() (6) = Trim() (7) = Trim() (8) = Trim() (9) = Trim() MsgBox 修改信息成功! , vbOKOnly + vbExclamation, 警告 = myBookmark Call viewData = True = True = True = True = False = False = False = False = False = False = False = False = False = False mcclean = True End If End Sub 單擊 [刪除記錄 ]按鈕就會刪除選擇的衛(wèi)生檢查工作人員信息,這部分代碼 見附錄。這部分代碼如下: Private Sub updateCommand_Click() Dim txtSQL As String Dim MsgText As String Dim mrcc As If mcclean Then MsgBox 請先輸入修改信息! , vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not Testtxt() Then MsgBox 請輸入姓名! , vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not IsNumeric(Trim()) Then MsgBox 請輸入數(shù)字! , vbOKOnly + vbExclamation, 警告 = Exit Sub End If If Not Testtxt() Then MsgBox 請輸入寢室號! , vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not Testtxt() Then MsgBox 請輸入電話號碼,以便聯(lián)系! , vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not Testtxt() Then MsgBox 請輸入學(xué)院! , vbOKOnly + vbExclamation, 警告 Exit Sub End If txtSQL = select * from hygiene_staff where 編號 = 39。用戶可以在這個界面查詢、修改和刪除衛(wèi)生檢查工 作人員信息。 Set mrcc = ExecuteSQL(txtSQL, MsgText) If = False Then MsgBox 宿舍號重復(fù),請重新輸入! , vbOKOnly + vbExclamation, 警告 Textdong(0).SetFocus Else (0) = Trim(Textdong(0).Text) (1) = Trim(Textdong(1).Text) (2) = Trim(Textdong(2).Text) (3) = Trim(Textdong(3).Text) (4) = Trim(Textdong(4).Text) (5) = Trim() (8) = Trim(Textdong(5).Text) MsgBox 修改寢室成員信息成功! , vbOKOnly + vbExclamation, 修改寢室成員信息 = myBookmark Call viewData = True cmdfirst(0).Enabled = True = True = True = True Textdong(0).Enabled = False Textdong(1).Enabled = False Textdong(2).Enabled = False Textdong(3).Enabled = False Textdong(4).Enabled = False Textdong(5).Enabled = False = False mcclean = True End If End Sub 單擊 [刪除記錄 ]按鈕就能刪除選擇的內(nèi)容,這部分代碼 見附錄。 and 年級 = 39。 and 寢室號 = 39。這部分代碼如下: Private Sub cmdUpdate_Click() Dim txtSQL As String Dim MsgText As String Dim mrcc As If mcclean Then MsgBox 請先修改宿舍成員信息 , vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not Testtxt(Textdong(0).Text) Then MsgBox 請輸入樓棟號! , vbOKOnly + vbExclamation, 警告 Textdong(0).SetFocus Exit Sub End If If Not Testtxt(Textdong(1).Text) Then MsgBox 請輸入宿舍號! , vbOKOnly + vbExclamation, 警告 Textdong(1).SetFocus Exit Sub End If If Not Testtxt(Textdong(2).Text) Then MsgBox 請輸入年級! , vbOKOnly + vbExclamation, 警告 Textdong(2).SetFocus Exit Sub End If If Not Testtxt(Textdong(3).Text) Then MsgBox 請輸入學(xué)院! , vbOKOnly + vbExclamation, 警告 Textdong(3).SetFocus Exit Sub End If If Not Testtxt(Textdong(4).Text) Then MsgBox 請選擇班號! , vbOKOnly + vbExclamation, 警告 Textdong(4).SetFocus Exit Sub End If If Not Testtxt(Textdong(5).Text) Then MsgBox 請輸入聯(lián)系電話! , vbOKOnly + vbExclamation, 警告 Textdong(5).SetFocus Exit Sub End If If Not Testtxt() Then MsgBox 請輸入全體寢室成員 ! , vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not IsNumeric(Trim(Textdong(0).Text)) Then MsgBox 學(xué)號請輸入數(shù)字! , vbOKOnly + vbExclamation, 警告 Textdong(0).SetFocus Exit Sub End If txtSQL = select * from reward_punish where 棟號 = 39。 order by 棟號 ,寢室號 Set mrc = ExecuteSQL(txtSQL, MsgText) If 0 Then = True Else = False End If With myflexgrid .Rows = 2 .CellAlignment = 4 .TextMatrix(1, 0) = 棟號 .TextMatrix(1, 1) = 寢室號 .TextMatrix(1, 2) = 年級 .TextMatrix(1, 3) = 學(xué)院 .TextMatrix(1, 4) = 專業(yè) .TextMatrix(1, 5) = 寢室成員 .TextMatrix(1, 6) = 電話 Do While Not .Rows = .Rows + 1 .CellAlignment = 4 .TextMatrix(.Rows 1, 0) = (0) .TextMatrix(.Rows 1, 1) = (1) .TextMatrix(.Rows 1, 2) = (2) .TextMatrix(.Rows 1, 3) = (3) .TextMatrix(.Rows 1, 4) = (4) .TextMatrix(.Rows 1, 5) = (5) .TextMatrix(.Rows 1, 6) = (8) Loop End With End Sub 這時單擊 [導(dǎo)出打印 ],就能把結(jié)果導(dǎo)出到 Mircosoft Excel 中,代碼 見附錄。 amp。 amp。 39。 Else txtSQL = txtSQL amp。 and 寢室號 = 39。 amp。 在宿舍成員查詢 ()窗體中實(shí)現(xiàn)查詢宿舍信息的功能,窗體如圖 56所示。輸入需要修改的信息后,單擊 [確定 ]按鈕,就可以修改成功 ,如圖 55所示。 Set mrc = ExecuteSQL(txtSQL, MsgText) If = True Then MsgBox 沒有這個用戶,請重新輸入用戶名 !, vbOKOnly + vbExclamation, 警告 Else If Trim((1)) = Trim() Then OK = True