a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 92|回复: 0

[Access] 获取窗体在记录跳转时触发了多少个事件

[复制链接]
发表于 2012-7-31 22:26:35 | 显示全部楼层 |阅读模式
获取窗体在记录跳转时触发了多少个事件; T9 C9 o9 f- U
将下列代码复制到模块中,并按F5运行,然后打开“窗体1”,做一些动作即可。- k8 m: [: X* W) d7 h
  Function setEvent()
: H/ S: O# }4 Q3 l5 U  Dim p As Property
3 ]7 W! I( ?: m( `, c( B( [  For Each p In Forms("窗体1").Properties
* F& g6 _7 s, s5 y: r  If Left(p.Name, 2) = "On" _2 r" ?- U  o3 J4 {$ P, Z- t; h
  Or Left(p.Name, 5) = "After" _
" S7 q, |3 C5 @: ^9 u  Or Left(p.Name, 6) = "Before" Then4 |* Z( n' r/ L2 u# A
  p.Value = "=msgbox('" & p.Name & "')": Q2 q6 T, p7 a
  End If( g' s! i+ K! L+ q/ z6 q
  Next p4 F! S% u4 ?1 d4 `
  End Function3 H3 f) o  X* n5 W+ p6 ~! j
  Function resumeEvent()
9 d+ D! n/ M, _( E+ E" H; M  P  Dim p As Property) j# F. I+ o& T. }
  For Each p In Forms("窗体1").Properties
& Y0 q/ M( g2 b# e  If Left(p.Name, 2) = "On" _
; H) ^1 W9 x) @/ j$ u' P  Or Left(p.Name, 5) = "After" _' {4 @/ N1 d5 }  d/ \6 }
  Or Left(p.Name, 6) = "Before" Then$ r8 R* C+ Q/ w" B) d% d
  p.Value = ""
/ {: J8 }" K% `* I% o" ^4 O  End If! p6 ]0 }/ L7 l( G1 ^
  Next p! V* a% S6 y% B* l
  End Function
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-6-18 21:58 , Processed in 0.304606 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表