五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

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

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

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

任務(wù)日期查詢(xún)數(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 類(lèi)別 = "" Or IsNull(類(lèi)別) = True Then

? ? MsgBox "類(lèi)別值為空!"

? ? 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!類(lèi)別.Value = 類(lèi)別.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查詢(xún)_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 類(lèi)別 <> "" Then

? ? If filter_text <> "" Then

? ? filter_text = filter_text & " and " & "類(lèi)別 like '*" & Me.類(lèi)別 & "*'"

? ? Else

? ? filter_text = "類(lèi)別 like '*" & Me.類(lèi)別 & "*'"

? ? 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 = ""

類(lèi)別.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 類(lèi)別 = "" Or IsNull(類(lèi)別) = True Then

MsgBox "類(lèi)別值為空!"

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

!類(lèi)別.Value = 類(lèi)別.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 "添加失??!"

End Sub


Private Sub Form_Load()

Me.是否完成 = False

End Sub


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

分享到微博請(qǐng)遵守國(guó)家法律
濮阳市| 安泽县| 金华市| 绥芬河市| 岳西县| 舟山市| 孝义市| 孝昌县| 驻马店市| 南召县| 江都市| 星座| 达拉特旗| 奉贤区| 巢湖市| 清苑县| 如皋市| 荥经县| 金坛市| 瑞丽市| 安陆市| 仁怀市| 长泰县| 堆龙德庆县| 五台县| 瓦房店市| 翁牛特旗| 泰宁县| 革吉县| 枣阳市| 尼勒克县| 景泰县| 肥城市| 陵水| 建始县| 伊宁县| 营口市| 博客| 怀柔区| 贡嘎县| 新河县|