a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 144|回复: 0

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

[复制链接]
发表于 2012-7-31 22:26:35 | 显示全部楼层 |阅读模式
清空窗体中各栏位资料, S* [$ _6 K( J& ]
Public Sub ClearD(frm As Form)
" o6 O  y- f/ D0 [3 f& U" r2 y4 E  Dim ctl As Control' c0 r4 F. o9 T! ]) ^: n5 @
  For Each ctlControl In frm.Controls7 Y  {) `& c( U! ~/ {
  If Typeof ctl is acTextBox Or Typeof ctl is acComboBox Then
8 e! K: n) s4 q3 }  y0 [5 n6 j  ctl = ""$ x, V* F& s7 D' p( I! m4 b# H% D
  DoEvents
% q. k  M  y( s1 v9 W- J  End If! f5 e  h& v+ n1 M+ y4 \
  Next
" }/ n: B. g8 @0 j  End Sub# N  C( o* m% D
  此程序稍一修改便可达到更多的功能如锁定或解锁各栏位
9 A& C/ U' k) b" f2 K0 W+ Q$ u. E! o  Public Sub LockControls(frm As Form, blnSta As Boolean)4 `3 ]9 x, A2 q# J8 S
  Dim ctl As Control! x/ {2 ]7 }; o7 a
  For Each ctl In frm.Controls
7 J4 j& \( E1 `: i  If TypeOf ctl Is acTextBox Or TypeOf ctl Is acComboBox Then# y/ d: b; m0 t5 @
  ctl.Enabled = blnSta% c1 f2 [& T* i  o: l4 A
  DoEvents" H( Y8 g1 O7 g2 L, o4 g
  End If3 h- X# {9 A4 [" |) ?8 B0 M3 R
  Next5 u% [# t6 ^/ w  O8 ]
  End Sub
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-28 06:46 , Processed in 0.451641 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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