a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 119|回复: 0

[Access] 清空窗体中各栏位资料

[复制链接]
发表于 2012-7-31 22:26:35 | 显示全部楼层 |阅读模式
清空窗体中各栏位资料
* P- p# U9 g/ TPublic Sub ClearD(frm As Form)
0 K" {5 x$ {5 w9 U* T  Dim ctl As Control1 k9 z) K1 W) E. S5 }+ D
  For Each ctlControl In frm.Controls5 e9 N* g: ^, V9 K; N7 h3 O' Q
  If Typeof ctl is acTextBox Or Typeof ctl is acComboBox Then
* p: l. J: `2 f, N2 P' v  ctl = ""
- t, t# ]! M' D, x- P+ w  DoEvents
& }. |6 r4 t7 P6 e4 }1 Z+ Q  End If
' W5 _: R, ^  A) W0 h  Next
0 I' W- j, V5 k, [' Y  m2 `6 ~, n  End Sub' H1 u8 X9 y. y# K
  此程序稍一修改便可达到更多的功能如锁定或解锁各栏位) [  X3 e& W  f7 b; j$ n* @/ Z! \
  Public Sub LockControls(frm As Form, blnSta As Boolean). l9 y7 T/ i2 z* x; s9 f
  Dim ctl As Control
: i" O5 W& x& R0 U  For Each ctl In frm.Controls
/ u" P8 |+ A# i3 s  If TypeOf ctl Is acTextBox Or TypeOf ctl Is acComboBox Then
+ O, Y4 |9 Q4 L4 _& @' u- w  ctl.Enabled = blnSta
& L" c, n2 b. j, s* K' J  DoEvents) H7 h, @5 c, Z9 G5 d/ N
  End If# y# J- c8 @' J# }7 e0 U
  Next6 L$ m: A9 |& k) d* C
  End Sub
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-8 05:31 , Processed in 0.158680 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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