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群 (群号:483923997) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 【Access窗体导出PDF】...(04.08)
- 【Access窗体导出PDF】...(04.07)
- Access两种方式实现即时更...(03.01)
- Access隐藏与显示lacc...(01.12)
- 【Access高效办公】将每个...(12.23)
- Access21点游戏源代码(12.13)
- 【Access窗体导出Exce...(11.15)
- 【Access开发】Acces...(11.14)
- 通过Access宏录入数据到选...(11.10)
学习心得
最新文章
- Access日期格式的数据导出Ex...(04.28)
- ACCESS精华集锦资料.CHM(04.25)
- Access VBA语句If Me...(04.24)
- 【Access修改记录示例】编辑选...(04.22)
- 【Access表名称命名建议】将A...(04.20)
- Access学习笔记--用Acce...(04.19)
- 【Access重复项查询示例】将A...(04.17)
- Access快速开发平台企业版--...(04.16)
- 【Access模块示例】通过模块代...(04.15)
- Access查询里面分组合计功能添...(04.13)