开发者

ms-access: clear text in all controls with one click

开发者 https://www.devze.com 2022-12-30 22:01 出处:网络
i have some comboboxes and some textboxes on a form i would like to clear all of them with开发者_如何学JAVA one line of code. is that possible?

i have some comboboxes and some textboxes on a form

i would like to clear all of them with开发者_如何学JAVA one line of code. is that possible?

something like all_controls.text=""


Not with one line of code. You will have to walk through all of the controls with a loop.

Dim ctl As Control
For Each ctl In Me.Controls
    If (ctl.ControlType = acTextBox) Then
        ctl.Value = Null
    End If
Next ctl

http://www.tek-tips.com/faqs.cfm?fid=5010

0

精彩评论

暂无评论...
验证码 换一张
取 消