msgbox的应用
时 间:2007-11-20 16:22:12
作 者:李双军 ID:18 城市:温州
摘 要:msgbox妙用
正 文:
在修改窗体中关闭按钮中加入msgbox提示框可以查看到哪些内容修改了
Private Sub Form_Load()
Me.RecordSource = "Select * FROM tbl_gys Where tbl_gys.gysID='" & strSelectID & "'"
strSelectID_old = strSelectID
Me.gysid.Enabled = False
Me.gyslbid.SetFocus
Me.bm.Caption = Me.gyslbid 'bm,bm1,bm2,bm3为标签
Me.bm1.Caption = Me.gysmc
If Not IsNull(Me.lxr) Then
Me.bm2.Caption = Me.lxr
End If
If Not IsNull(Me.lxdh) Then
Me.bm3.Caption = Me.lxdh
End If
End Sub
Private Sub ToolbarFrm_ButtonClick(ByVal Button As Object)
'刷新当前窗体内容
Dim a, b, c, d As String
a = ""
b = ""
c = ""
d = ""
Me.Refresh
If Me.bm.Caption <> Me.gyslbid Then
a = "您确认要修改此供应商类别为【" & Me.gyslbid & "】吗? "
End If
If Me.bm1.Caption <> Me.gysmc Then
b = "您确认要修改此供应商为【" & Me.gysmc & "】吗?"
End If
If Me.bm2.Caption <> Me.lxr Then
c = "您确认要修改此联系人为【" & Me.lxr & "】吗?"
End If
If Me.bm3.Caption <> Me.lxdh Then
d = "您确认要修改此联系电话为【" & Me.lxdh & "】吗?"
End If
If a <> "" or b <> "" or c <> "" or d <> "" Then
If MsgBox("" & a & Chr(13) & b & Chr(13) & c & Chr(13) & d & "", vbOKCancel + vbInformation, "提示") = vbOK Then
DoCmd.Echo False
Forms!usysfrmMain!frmChild.SourceObject = "frm_gys_child"
DoCmd.Echo True
Forms!usysfrmMain!frmChild.Form.TimerInterval = 300
DoCmd.Close acForm, "frm_gys_child_Edit"
End If
Exit Sub
End If
Forms!usysfrmMain!frmChild.Form.TimerInterval = 300
DoCmd.Close acForm, "frm_gys_child_Edit"
End Sub
在msgbox的提示中加入Chr(13)是进行回车,这样就可以显示几行了也可以用Chr(11)换行来代替,
这个效果不错,呵呵,大家可以试一下,再修改一下就可以对修改的内容进行取消恢复了
Access软件网官方交流QQ群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 【Access高效办公】统计当...(06.30)
- 【Access高效办公】用复选...(06.24)
- 根据变化的日期来自动编号的示例...(06.20)
- 【Access高效办公】按日期...(06.12)
- 合并列数据到一个文本框的示例;...(05.06)
- 通过命令按钮让Access列表...(04.24)
- 【Access高效办公】统计当...(03.11)
- 【Access Inputbo...(03.03)
- 按回车键后光标移动到下一条记录...(02.12)

学习心得
最新文章
- Access快速开发平台--执行有...(07.03)
- 【Access高效办公】统计当月之...(06.30)
- 【Access高效办公】用复选框控...(06.24)
- 根据变化的日期来自动编号的示例;根...(06.20)
- Access快速开发平台--Acc...(06.16)
- 【Access高效办公】按日期区间...(06.12)
- Access快速开发平台--生成复...(06.07)
- 仓库管理实战课程(25)-导航菜单...(06.06)
- 仓库管理实战课程(24)-库存月结...(06.05)
- 分享一个简单的X氏家谱小示例(06.04)