设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

清空窗体中各栏位资料

1970-1-1 08:00| 发布者: harsonliao| 查看: 2124| 评论: 0

Public Sub ClearD(frm As Form)
  Dim ctl As Control
  For Each ctlControl In frm.Controls
     If Typeof ctl is acTextBox Or Typeof ctl is acComboBox Then
      ctl = ""
      DoEvents
     End If
  Next
End Sub

此程序稍一修改便可达到更多的功能如锁定或解锁各栏位

Public Sub LockControls(frm As Form, blnSta As Boolean)
  Dim ctl As Control
  For Each ctl In frm.Controls
     If TypeOf ctl Is acTextBox Or TypeOf ctl Is acComboBox Then
      ctl.Enabled = blnSta
      DoEvents
     End If
  Next
End Sub

最新评论

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-7 01:08 , Processed in 0.058525 second(s), 16 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部