•本系统包含主要功能有:家庭成员管理,收支管理,理财管理,存款管理,收支统计,理财统计,存款统计,生成报表。
•商品中包含简要的设计报告(功能模块图,业务流程图,UC矩阵,数据流图,数据字典,E-R图等)和制作截图文档。
•数据库系统包含:表,查询,窗体,报表,VBA代码
•系统为单机使用的access数据库系统,可作为课程学习实例使用。
设计部分
功能模块图
业务流程图
数据流程
E-R图
程序流程图
关系模型
理财(家庭成员,理财项目,理财内容,开始日期,结束日期,本金,收益率,收入,备注)
收支(日期,类型,家庭成员,项目,内容,收入金额,支出金额,备注)
家庭成员(姓名,性别,家庭关系,生日,职业状态,联系方式,备注)
存款(账户,户名,存取类型,存入,取出,日期,备注)
系统部分
表关系
窗体
VBA代码
系统主页
Private Sub Command参数设置_Click()
Me.显示界面子窗体.SourceObject = "参数设置"
Me.显示界面子窗体.SetFocus
End Sub
Private Sub Command存款管理_Click()
Me.显示界面子窗体.SourceObject = "存款管理"
Me.显示界面子窗体.SetFocus
End Sub
Private Sub Command存款统计_Click()
Me.显示界面子窗体.SourceObject = "存款统计查询"
Me.显示界面子窗体.SetFocus
End Sub
Private Sub Command家庭成员管理_Click()
Me.显示界面子窗体.SourceObject = "家庭成员管理"
Me.显示界面子窗体.SetFocus
End Sub
Private Sub Command理财管理_Click()
Me.显示界面子窗体.SourceObject = "理财管理"
Me.显示界面子窗体.SetFocus
End Sub
Private Sub Command理财统计_Click()
Me.显示界面子窗体.SourceObject = "理财统计查询"
Me.显示界面子窗体.SetFocus
End Sub
Private Sub Command收支管理_Click()
Me.显示界面子窗体.SourceObject = "收支管理"
Me.显示界面子窗体.SetFocus
End Sub
Private Sub Command收支统计查询_Click()
Me.显示界面子窗体.SourceObject = "收支统计查询"
Me.显示界面子窗体.SetFocus
End Sub
Private Sub Command退出系统_Click()
If MsgBox("是否退出系统", vbYesNo) <> vbYes Then
Exit Sub
End If
Application.Quit acQuitSaveAll
End Sub
Private Sub Command系统后台_Click()
DoCmd.Close acForm, Me.Name
DoCmd.SelectObject acForm, , True
End Sub
存款管理
Option Compare Database
Private Sub Command报表_Click()
If Me.数据表子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "存款记录报表", acViewReport, , Me.数据表子窗体.Form.Filter
Else
DoCmd.OpenReport "存款记录报表", acViewReport
End If
End Sub
Private Sub Command查询_Click()
On Error GoTo 结束查询
If 查询内容 <> "" And IsNull(查询内容) = False And 查询字段 <> "" And IsNull(查询字段) = False Then
If 查询字段.Value = "日期" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & " =#" & Me.查询内容 & "#"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
If 查询字段.Value = "存入" Or 查询字段.Value = "取出" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & ">= " & Me.查询内容
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
Me.数据表子窗体.Form.Filter = Me.查询字段 & " like '*" & Me.查询内容 & "*'"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Else
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End If
Exit Sub
结束查询:
MsgBox Err.Description
End Sub
Private Sub Command清空_Click()
账户.Value = ""
户名.Value = ""
存取类型.Value = ""
存入.Value = ""
取出.Value = ""
日期.Value = ""
备注.Value = ""
账户余额.Value = ""
End Sub
Private Sub Command全部_Click()
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End Sub
Private Sub Command添加_Click()
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
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("存款表", dbOpenTable)
With add_rs
.AddNew
!账户.Value = 账户.Value
!户名.Value = 户名.Value
!存取类型.Value = 存取类型.Value
!存入.Value = 存入.Value
!取出.Value = 取出.Value
!日期.Value = 日期.Value
!备注.Value = 备注.Value
.Update
.Close
End With
Set add_rs = Nothing
MsgBox "添加完成"
Me.数据表子窗体.Form.Requery
End Sub
Private Sub 账户_Change()
If 账户 <> "" Then
账户余额.Value = Nz(DLookup("余额", "存款统计查询", "账户='" & Me.账户 & "'"), 0)
Else
账户余额.Value = ""
End If
End Sub
存款数据表
Private Sub Form_BeforeUpdate(Cancel As Integer)
If 账户.Value <> "" And 户名.Value <> "" And 存取类型.Value <> "" And 存入.Value <> "" And 取出.Value <> "" And 日期.Value <> "" Then
On Error GoTo 数据更新前提醒_Err
If (MsgBox("是否保存对记录的修改", 1, "修改记录提醒") = 1) Then
Beep
Else
DoCmd.RunCommand acCmdUndo
End If
Else
MsgBox "账户,户名,存取类型,存入,取出,日期都不能为空"
On Error Resume Next
DoCmd.RunCommand acCmdUndo
Exit Sub
End If
数据更新前提醒_Exit:
Exit Sub
数据更新前提醒_Err:
MsgBox Error$
Resume 数据更新前提醒_Exit
End Sub
Private Sub 存款ID_DblClick(Cancel As Integer)
If MsgBox("是否删除该记录:" & Me.存款ID & "?", vbYesNo) = vbYes Then
DoCmd.SetWarnings (False)
Dim del_sql As String
del_sql = "Delete From 存款表 Where 存款ID = " & 存款ID
DoCmd.RunSQL del_sql
Me.Requery
End If
End Sub
存款统计查询
Private Sub Command报表_Click()
If Me.数据表子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "存款统计报表", acViewReport, , Me.数据表子窗体.Form.Filter
Else
DoCmd.OpenReport "存款统计报表", acViewReport
End If
End Sub
Private Sub Command查询_Click()
On Error GoTo 结束查询
If 查询内容 <> "" And IsNull(查询内容) = False And 查询字段 <> "" And IsNull(查询字段) = False Then
If 查询字段.Value = "日期" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & " =#" & Me.查询内容 & "#"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
If 查询字段.Value = "存入合计" Or 查询字段.Value = "取出合计" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & ">= " & Me.查询内容
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
Me.数据表子窗体.Form.Filter = Me.查询字段 & " like '*" & Me.查询内容 & "*'"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Else
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End If
Exit Sub
结束查询:
MsgBox Err.Description
End Sub
Private Sub Command全部_Click()
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End Sub
家庭成员查询数据表
Private Sub Form_BeforeUpdate(Cancel As Integer)
If 姓名.Value <> "" And 性别.Value <> "" And 家庭关系.Value <> "" And 生日.Value <> "" And 职业状态.Value <> "" And 联系方式.Value <> "" Then
On Error GoTo 数据更新前提醒_Err
If (MsgBox("是否保存对记录的修改", 1, "修改记录提醒") = 1) Then
Beep
Else
DoCmd.RunCommand acCmdUndo
End If
Else
MsgBox "姓名,性别,家庭关系,生日,职业状态,联系方式都不能为空"
On Error Resume Next
DoCmd.RunCommand acCmdUndo
Exit Sub
End If
数据更新前提醒_Exit:
Exit Sub
数据更新前提醒_Err:
MsgBox Error$
Resume 数据更新前提醒_Exit
End Sub
Private Sub 姓名_DblClick(Cancel As Integer)
If MsgBox("是否删除该记录:" & Me.姓名 & "?注意:删除家庭成员后涉及关联的收支理财等记录也会被删除", vbYesNo) = vbYes Then
DoCmd.SetWarnings (False)
Dim del_sql As String
del_sql = "Delete From 家庭成员表 Where 姓名 = '" & 姓名 & "'"
DoCmd.RunSQL del_sql
Me.Requery
End If
End Sub
家庭成员管理
Option Compare Database
Private Sub Command报表_Click()
If Me.数据表子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "家庭成员标签", acViewReport, , Me.数据表子窗体.Form.Filter
Else
DoCmd.OpenReport "家庭成员标签", acViewReport
End If
End Sub
Private Sub Command查询_Click()
On Error GoTo 结束查询
If 查询内容 <> "" And IsNull(查询内容) = False And 查询字段 <> "" And IsNull(查询字段) = False Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & " like '*" & Me.查询内容 & "*'"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Else
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End If
Me.数据表子窗体.SetFocus
Exit Sub
结束查询:
MsgBox Err.Description
End Sub
Private Sub Command清空_Click()
姓名.Value = ""
性别.Value = ""
家庭关系.Value = ""
生日.Value = ""
职业状态.Value = ""
联系方式.Value = ""
备注.Value = ""
End Sub
Private Sub Command全部_Click()
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End Sub
Private Sub Command添加_Click()
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
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
If Nz(DCount("姓名", "家庭成员表", "姓名='" & Me.姓名 & "'"), 0) > 0 Then
MsgBox "该家庭成员姓名已存在!不能重复"
Exit Sub
End If
On Error Resume Next
DoCmd.SetWarnings (False)
Dim add_sql As String
add_sql = "Insert Into 家庭成员表 (姓名,性别,家庭关系,生日,职业状态,联系方式,备注) Values ('" & 姓名 & "','" & 性别 & "','" & 家庭关系 & "',#" & 生日 & "#,'" & 职业状态 & "','" & 联系方式 & "','" & 备注 & "')"
DoCmd.RunSQL add_sql
MsgBox "添加完成"
Me.数据表子窗体.Form.Requery
End Sub
理财管理
Option Compare Database
Private Sub Command报表_Click()
If Me.数据表子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "理财记录报表", acViewReport, , Me.数据表子窗体.Form.Filter
Else
DoCmd.OpenReport "理财记录报表", acViewReport
End If
End Sub
Private Sub Command查询_Click()
On Error GoTo 结束查询
If 查询内容 <> "" And IsNull(查询内容) = False And 查询字段 <> "" And IsNull(查询字段) = False Then
If 查询字段.Value = "日期" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & " =#" & Me.查询内容 & "#"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
If 查询字段.Value = "本金" Or 查询字段.Value = "收入" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & ">= " & Me.查询内容
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
Me.数据表子窗体.Form.Filter = Me.查询字段 & " like '*" & Me.查询内容 & "*'"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Else
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End If
Exit Sub
结束查询:
MsgBox Err.Description
End Sub
Private Sub Command清空_Click()
家庭成员.Value = ""
理财项目.Value = ""
理财内容.Value = ""
开始日期.Value = ""
结束日期.Value = ""
本金.Value = ""
收益率.Value = ""
收入.Value = ""
备注.Value = ""
End Sub
Private Sub Command全部_Click()
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End Sub
Private Sub Command收入收益率_Click()
If Me.收入 <> "" And Me.本金 <> "" And Me.本金 <> 0 Then
Me.收益率 = Me.收入 / Me.本金
Else
Me.收益率 = ""
End If
End Sub
Private Sub Command收益率收入_Click()
If Me.收益率 <> "" And Me.本金 <> "" Then
Me.收入 = Me.收益率 * Me.本金
Else
Me.收入 = ""
End If
End Sub
Private Sub Command添加_Click()
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
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
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("理财表", dbOpenTable)
With add_rs
.AddNew
!家庭成员.Value = 家庭成员.Value
!理财项目.Value = 理财项目.Value
!理财内容.Value = 理财内容.Value
!开始日期.Value = 开始日期.Value
!结束日期.Value = 结束日期.Value
!本金.Value = 本金.Value
!收益率.Value = 收益率.Value
!收入.Value = 收入.Value
!备注.Value = 备注.Value
.Update
.Close
End With
Set add_rs = Nothing
MsgBox "添加完成"
Me.数据表子窗体.Form.Requery
End Sub
理财数据表
Private Sub Form_BeforeUpdate(Cancel As Integer)
If 家庭成员.Value <> "" And 理财项目.Value <> "" And 理财内容.Value <> "" And 开始日期.Value <> "" And 结束日期.Value <> "" And 本金.Value <> "" And 收益率.Value <> "" And 收入.Value <> "" Then
On Error GoTo 数据更新前提醒_Err
If (MsgBox("是否保存对记录的修改", 1, "修改记录提醒") = 1) Then
Beep
Else
DoCmd.RunCommand acCmdUndo
End If
Else
MsgBox "家庭成员,理财项目,理财内容,开始日期,结束日期,本金,收益率,收入都不能为空"
On Error Resume Next
DoCmd.RunCommand acCmdUndo
Exit Sub
End If
Exit Sub
数据更新前提醒_Err:
MsgBox Error$
End Sub
Private Sub 理财ID_DblClick(Cancel As Integer)
If MsgBox("是否删除该记录:" & Me.理财ID & "?", vbYesNo) = vbYes Then
DoCmd.SetWarnings (False)
Dim del_sql As String
del_sql = "Delete From 理财表 Where 理财ID = " & 理财ID
DoCmd.RunSQL del_sql
Me.Requery
End If
End Sub
理财统计查询
Private Sub Command报表_Click()
If Me.数据表子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "理财统计报表", acViewReport, , Me.数据表子窗体.Form.Filter
Else
DoCmd.OpenReport "理财统计报表", acViewReport
End If
End Sub
Private Sub Command查询_Click()
On Error GoTo 结束查询
If 查询内容 <> "" And IsNull(查询内容) = False And 查询字段 <> "" And IsNull(查询字段) = False Then
If 查询字段.Value = "日期" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & " =#" & Me.查询内容 & "#"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
If 查询字段.Value = "本金合计" Or 查询字段.Value = "收入合计" Or 查询字段.Value = "平均收益率" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & ">= " & Me.查询内容
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
Me.数据表子窗体.Form.Filter = Me.查询字段 & " like '*" & Me.查询内容 & "*'"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Else
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End If
Exit Sub
结束查询:
MsgBox Err.Description
End Sub
Private Sub Command全部_Click()
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End Sub
理财项目数据表
Private Sub Form_BeforeUpdate(Cancel As Integer)
If 理财项目.Value <> "" Then
On Error GoTo 数据更新前提醒_Err
If (MsgBox("是否保存对记录的修改", 1, "修改记录提醒") = 1) Then
Beep
Else
DoCmd.RunCommand acCmdUndo
End If
Else
MsgBox "理财项目不能为空"
On Error Resume Next
DoCmd.RunCommand acCmdUndo
Exit Sub
End If
Exit Sub
数据更新前提醒_Err:
MsgBox Error$
End Sub
Private Sub 理财项目_DblClick(Cancel As Integer)
If MsgBox("是否删除该记录:" & Me.理财项目 & "?", vbYesNo) = vbYes Then
DoCmd.SetWarnings (False)
Dim del_sql As String
del_sql = "Delete From 理财项目表 Where 理财项目 = '" & Me.理财项目 & "'"
DoCmd.RunSQL del_sql
Me.Requery
End If
End Sub
收支管理
Option Compare Database
Private Sub Command报表_Click()
If Me.数据表子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "收支记录报表", acViewReport, , Me.数据表子窗体.Form.Filter
Else
DoCmd.OpenReport "收支记录报表", acViewReport
End If
End Sub
Private Sub Command查询_Click()
On Error GoTo 结束查询
If 查询内容 <> "" And IsNull(查询内容) = False And 查询字段 <> "" And IsNull(查询字段) = False Then
If 查询字段.Value = "日期" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & " =#" & Me.查询内容 & "#"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
If 查询字段.Value = "收入" Or 查询字段.Value = "支出" Then
Me.数据表子窗体.Form.Filter = Me.查询字段 & ">= " & Me.查询内容
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Exit Sub
End If
Me.数据表子窗体.Form.Filter = Me.查询字段 & " like '*" & Me.查询内容 & "*'"
Me.数据表子窗体.Form.FilterOn = True
Me.数据表子窗体.Requery
Else
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End If
Exit Sub
结束查询:
MsgBox Err.Description
End Sub
Private Sub Command清空_Click()
日期.Value = ""
类型.Value = ""
家庭成员.Value = ""
项目.Value = ""
内容.Value = ""
收入.Value = ""
支出.Value = ""
备注.Value = ""
End Sub
Private Sub Command全部_Click()
Me.数据表子窗体.Form.FilterOn = False
Me.数据表子窗体.Requery
End Sub
Private Sub Command添加_Click()
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
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("收支表", dbOpenTable)
With add_rs
.AddNew
!日期.Value = 日期.Value
!类型.Value = 类型.Value
!家庭成员.Value = 家庭成员.Value
!项目.Value = 项目.Value
!内容.Value = 内容.Value
!收入.Value = 收入.Value
!支出.Value = 支出.Value
!备注.Value = 备注.Value
.Update
.Close
End With
Set add_rs = Nothing
MsgBox "添加完成"
Me.数据表子窗体.Form.Requery
End Sub
收支数据表
Private Sub Form_BeforeUpdate(Cancel As Integer)
If 日期.Value <> "" And 类型.Value <> "" And 家庭成员.Value <> "" And 项目.Value <> "" And 内容.Value <> "" And 收入.Value <> "" And 支出.Value <> "" Then
On Error GoTo 数据更新前提醒_Err
If (MsgBox("是否保存对记录的修改", 1, "修改记录提醒") = 1) Then
Beep
Else
DoCmd.RunCommand acCmdUndo
End If
Else
MsgBox "日期,类型,家庭成员,项目,内容,收入,支出都不能为空"
On Error Resume Next
DoCmd.RunCommand acCmdUndo
Exit Sub
End If
数据更新前提醒_Exit:
Exit Sub
数据更新前提醒_Err:
MsgBox Error$
Resume 数据更新前提醒_Exit
End Sub
Private Sub 收支ID_DblClick(Cancel As Integer)
If MsgBox("是否删除该记录:" & Me.收支ID & "?", vbYesNo) = vbYes Then
DoCmd.SetWarnings (False)
Dim del_sql As String
del_sql = "Delete From 收支表 Where 收支ID = " & 收支ID
DoCmd.RunSQL del_sql
Me.Requery
End If
End Sub
收支统计查询
Private Sub Command报表_Click()
If Me.收支项目统计子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "收支项目统计报表", acViewReport, , Me.收支项目统计子窗体.Form.Filter
Else
DoCmd.OpenReport "收支项目统计报表", acViewReport
End If
End Sub
Private Sub Command报表2_Click()
If Me.月收支统计子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "月收支统计报表", acViewReport, , Me.月收支统计子窗体.Form.Filter
Else
DoCmd.OpenReport "月收支统计报表", acViewReport
End If
End Sub
Private Sub Command报表3_Click()
If Me.数据表子窗体.Form.FilterOn = True Then
DoCmd.OpenReport "家庭成员收支统计报表", acViewReport, , Me.数据表子窗体.Form.Filter
Else
DoCmd.OpenReport "家庭成员收支统计报表", acViewReport
End If
End Sub
收支项目数据表
Private Sub Form_BeforeUpdate(Cancel As Integer)
If 项目.Value <> "" And 类型.Value <> "" Then
On Error GoTo 数据更新前提醒_Err
If (MsgBox("是否保存对记录的修改", 1, "修改记录提醒") = 1) Then
Beep
Else
DoCmd.RunCommand acCmdUndo
End If
Else
MsgBox "项目和类型都不能为空"
On Error Resume Next
DoCmd.RunCommand acCmdUndo
Exit Sub
End If
Exit Sub
数据更新前提醒_Err:
MsgBox Error$
End Sub
Private Sub 项目_DblClick(Cancel As Integer)
If MsgBox("是否删除该记录:" & Me.项目 & "?", vbYesNo) = vbYes Then
DoCmd.SetWarnings (False)
Dim del_sql As String
del_sql = "Delete From 收支项目表 Where 项目 = '" & Me.项目 & "'"
DoCmd.RunSQL del_sql
Me.Requery
End If
End Sub
需要系统原文件和全部设计资料可访问同名↓
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。