国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

任務(wù)日程管理系統(tǒng)-VBA代碼

2022-04-18 22:04 作者:凌霄百科  | 我要投稿

任務(wù)日期查詢數(shù)據(jù)表


任務(wù)日程管理

Private Sub Command保存_Click()

If MsgBox("是否保存對(duì)記錄的修改", vbOKCancel) <> vbOK Then

Exit Sub

End If

If Me.任務(wù)ID <> "" Then

? ? If 日期 = "" Or IsNull(日期) = True Then

? ? MsgBox "日期值為空!"

? ? Exit Sub

? ? End If

? ? If 標(biāo)題 = "" Or IsNull(標(biāo)題) = True Then

? ? MsgBox "標(biāo)題值為空!"

? ? Exit Sub

? ? End If

? ? If 類別 = "" Or IsNull(類別) = True Then

? ? MsgBox "類別值為空!"

? ? Exit Sub

? ? End If

? ? If 重要程度 = "" Or IsNull(重要程度) = True Then

? ? MsgBox "重要程度值為空!"

? ? Exit Sub

? ? End If

? ? If 是否完成 = "" Or IsNull(是否完成) = True Then

? ? MsgBox "是否完成值為空!"

? ? Exit Sub

? ? End If

? ? Dim search_rs As DAO.Recordset

? ? Dim search_sql As String

? ? search_sql = "Select * From 任務(wù)日程表 Where 任務(wù)ID=" & Me.任務(wù)ID

? ? Set search_rs = CurrentDb.OpenRecordset(search_sql, dbOpenDynaset)

? ? If search_rs.EOF = False Then

? ? search_rs.Edit

? ? search_rs!日期.Value = 日期.Value

? ? search_rs!時(shí)間段.Value = 時(shí)間段.Value

? ? search_rs!標(biāo)題.Value = 標(biāo)題.Value

? ? search_rs!內(nèi)容.Value = 內(nèi)容.Value

? ? search_rs!標(biāo)簽.Value = 標(biāo)簽.Value

? ? search_rs!類別.Value = 類別.Value

? ? search_rs!重要程度.Value = 重要程度.Value

? ? search_rs!是否完成.Value = 是否完成.Value

? ? search_rs.Update

? ? End If

? ? search_rs.Close

? ? Set search_rs = Nothing

? ? MsgBox "保存完成"

? ? Me.數(shù)據(jù)表子窗體.Requery

Else

? ? MsgBox "請(qǐng)選擇任務(wù)ID"

? ? Exit Sub

End If

End Sub


Private Sub Command查詢_Click()

Me.任務(wù)ID = ""

Dim filter_text As String

If 日期 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "日期>#" & Me.日期 & "#"

? ? Else

? ? filter_text = "日期>#" & Me.日期 & "#"

? ? End If

End If

If 時(shí)間段 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "時(shí)間段 like '*" & Me.時(shí)間段 & "*'"

? ? Else

? ? filter_text = "時(shí)間段 like '*" & Me.時(shí)間段 & "*'"

? ? End If

End If

If 標(biāo)題 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "標(biāo)題 like '*" & Me.標(biāo)題 & "*'"

? ? Else

? ? filter_text = "標(biāo)題 like '*" & Me.標(biāo)題 & "*'"

? ? End If

End If

If 內(nèi)容 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "內(nèi)容 like '*" & Me.內(nèi)容 & "*'"

? ? Else

? ? filter_text = "內(nèi)容 like '*" & Me.內(nèi)容 & "*'"

? ? End If

End If

If 標(biāo)簽 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "標(biāo)簽 like '*" & Me.標(biāo)簽 & "*'"

? ? Else

? ? filter_text = "標(biāo)簽 like '*" & Me.標(biāo)簽 & "*'"

? ? End If

End If

If 類別 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "類別 like '*" & Me.類別 & "*'"

? ? Else

? ? filter_text = "類別 like '*" & Me.類別 & "*'"

? ? End If

End If

If 重要程度 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "重要程度 like '*" & Me.重要程度 & "*'"

? ? Else

? ? filter_text = "重要程度 like '*" & Me.重要程度 & "*'"

? ? End If

End If

If 是否完成 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "是否完成 =" & Me.是否完成

? ? Else

? ? filter_text = "是否完成 =" & Me.是否完成

? ? End If

End If

If filter_text <> "" Then

Me.數(shù)據(jù)表子窗體.Form.Filter = filter_text

Me.數(shù)據(jù)表子窗體.Form.FilterOn = True

Else

Me.數(shù)據(jù)表子窗體.Form.FilterOn = False

End If

End Sub


Private Sub Command清空_Click()

任務(wù)ID.Value = ""

日期.Value = ""

時(shí)間段.Value = ""

標(biāo)題.Value = ""

內(nèi)容.Value = ""

標(biāo)簽.Value = ""

類別.Value = ""

重要程度.Value = ""

Me.是否完成 = False

End Sub


Private Sub Command全部_Click()

Me.任務(wù)ID = ""

Me.數(shù)據(jù)表子窗體.Form.FilterOn = False

End Sub


Private Sub Command刪除_Click()

If MsgBox("是否刪除該記錄", vbOKCancel) <> vbOK Then

Exit Sub

End If

If Me.任務(wù)ID <> "" Then

? ? DoCmd.SetWarnings (False)

? ? Dim del_sql As String

? ? del_sql = "Delete From 任務(wù)日程表 Where? 任務(wù)ID=" & Me.任務(wù)ID

? ? DoCmd.RunSQL del_sql

? ? MsgBox "刪除完成"

? ? Call Command清空_Click

? ? Me.數(shù)據(jù)表子窗體.Requery

Else

? ? MsgBox "請(qǐng)選擇任務(wù)ID"

? ? Exit Sub

End If

End Sub


Private Sub Command添加_Click()

On Error GoTo 添加失敗錯(cuò)誤




If 日期 = "" Or IsNull(日期) = True Then

MsgBox "日期值為空!"

Exit Sub

End If


If 標(biāo)題 = "" Or IsNull(標(biāo)題) = True Then

MsgBox "標(biāo)題值為空!"

Exit Sub

End If



If 類別 = "" Or IsNull(類別) = True Then

MsgBox "類別值為空!"

Exit Sub

End If

If 重要程度 = "" Or IsNull(重要程度) = True Then

MsgBox "重要程度值為空!"

Exit Sub

End If

If 是否完成 = "" Or IsNull(是否完成) = True Then

MsgBox "是否完成值為空!"

Exit Sub

End If



Dim add_rs As DAO.Recordset

Set add_rs = CurrentDb.OpenRecordset("任務(wù)日程表", dbOpenTable)

With add_rs

.AddNew


!日期.Value = 日期.Value

!時(shí)間段.Value = 時(shí)間段.Value

!標(biāo)題.Value = 標(biāo)題.Value

!內(nèi)容.Value = 內(nèi)容.Value

!標(biāo)簽.Value = 標(biāo)簽.Value

!類別.Value = 類別.Value

!重要程度.Value = 重要程度.Value

!是否完成.Value = 是否完成.Value

.Update

.Close

End With

Set add_rs = Nothing



MsgBox "添加成功!"

Me.數(shù)據(jù)表子窗體.Requery

Me.任務(wù)ID = ""

Exit Sub

添加失敗錯(cuò)誤:

MsgBox "添加失?。?#34;

End Sub


Private Sub Form_Load()

Me.是否完成 = False

End Sub


任務(wù)日程管理系統(tǒng)-VBA代碼的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
黔西县| 萝北县| 衢州市| 陆良县| 高青县| 盐山县| 莎车县| 石河子市| 芦山县| 青州市| 泰兴市| 右玉县| 宁远县| 宜兴市| 神池县| 兴义市| 科尔| 马山县| 东至县| 吉林省| 崇阳县| 都安| 仙桃市| 奇台县| 宁阳县| 晴隆县| 会泽县| 西昌市| 满城县| 樟树市| 同仁县| 肇东市| 罗江县| 和田市| 铜山县| 辽阳市| 泰和县| 象州县| 岗巴县| 米泉市| 和平县|