如何根据另一个文本框中的值隐藏文本框? [英] How to Hide textbox based on the value from another textbox?

查看:110
本文介绍了如何根据另一个文本框中的值隐藏文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据文本框中的值隐藏textbox2。例如:如果textbox1中的输入是"Gerente",那么然后textbox2应该隐藏或锁定。谢谢!

I want to hide textbox2 based on the value from the textbox. For example: If the input in textbox1 is "Gerente" then textbox2 should hide or lock. Thank you!

推荐答案

您可以使用textbox1控件的AfterUpdate事件:

You could use the AfterUpdate event of the textbox1 control:

Private Sub textbox1_Afterupdate()

Private Sub textbox1_Afterupdate()

如果Me.textbox1 =" Gerente"然后

   Me.textbox2.Visible = False

否则为
   Me.textbox2.Visible = True

结束如果



End Sub

If Me.textbox1 = "Gerente" Then
   Me.textbox2.Visible = False
Else
   Me.textbox2.Visible = True
End if

End Sub


这篇关于如何根据另一个文本框中的值隐藏文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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