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设置试用期截止日期默认...(08.15)
- Access快速开发平台--Err...(08.12)
- Deepseek资料整理神器(08.11)
- 【Access财务分析示例】按月统...(08.08)
- Access查询里使用Date()...(08.05)
- 关于Access交叉表查询生成的统...(08.02)
- ACCESS做的工作日常小工具_纸...(07.30)
- Access快速开发平台进销存教程...(07.28)
- 关于Access快速开发平台2.6...(07.23)
- 【Access交叉表查询】按百分比...(07.21)