在MS Access中的窗体上的文本框之间循环 [英] Cycling through textboxes on form in MS Access

查看:117
本文介绍了在MS Access中的窗体上的文本框之间循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过表单中的多个文本框建立索引,以通过更新后事件更改可视属性.该事件在组合框指定多个文本框循环显示之后发生.所有的文本框都被命名为"V1,V2,V3 ... V110,等等."我对VBA和Access还是比较陌生,我该如何编码呢?​​

I'm trying to index through multiple textboxes in a form to change the Visible Property through an after Update event. The event occurs after a combo box designates a number of textboxes to cycle through. All the textboxes are named "V1, V2, V3...V110, etc.) I'm relatively new to VBA and Access, how would I go about coding this?

推荐答案

您可以使用以下子

    Option Explicit

    Sub ChangeTextBoxVisibility(iMin As Long, iMax As Long, visibilityState As Boolean)
        Dim i As Long
        With Me
            For i = iMin To iMax
                .Controls("V" & i).Visible = visibilityState
            Next i
        End With
    End Sub

称为

ChangeTextBoxVisibility 3, 90, False'<--| set not visible all textboxes from "V3" to "V90"

这篇关于在MS Access中的窗体上的文本框之间循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆