基于组合框选择的新字段 [英] New fields based on combo box selection
问题描述
我在XP上使用2002 Access。在表单中,我创建了一个包含四种不同选择的组合框。根据所做的选择,我希望出现相应的字段。我在组合框中的四个选择是Realtor,Driving,Mailing或Other。如果是房地产经纪人被选中我想要一个字段出现,询问房地产经纪人的名字和另一个要求房地产经纪人电话号码的字段。如果驾驶被选中,我想要一个字段来要求约会。如果邮寄,则相同被选中。如果是其他如果选择了,我希望该字段显示在您可以输入文字的地方进行解释。
我感觉答案位于属性下的某处。对于我的组合框而言,那里有很多东西,这一切都在我脑海中。感谢您的帮助!
在您的属性中将所有字段设置为可见,然后在更新后的组合框中,即使在属性中也是如此需要大量这样的代码
如果me.ComboName =" Realtor"然后
me.name of textbox.visible = True
else
if me.ComboName =" Whatever"然后
me.Whatever.Visible = True
结束如果
希望那就是你想要做的事
感谢您的建议!
我尝试了但是我无法将任何字段更改为visible = no。我收到一条错误消息,内容为您无法隐藏具有焦点的控件。
这是什么意思?
< blockquote> Ferguson,
首先,代码读取
Hi everybody! I''m a total newbie at access, just opened it for the first time yesterday so bear with me. I tried a search for my answer and found similar topics but couldn''t find the exact answer.
I''m using 2002 Access on XP. In a form, I created a combo box with four different choices. Depending on the selection made I would like a corresponding field to appear. My four selections in the combo box are "Realtor", "Driving", "Mailing", or "Other". If "Realtor" is selected I want a field to appear that asks for the realtor''s name and another field that asks for the realtor''s phone number. If "Driving" is selected, I want a field to ask for a date. Same for if "Mailing" is selected. If "Other" is selected, I''d like the field to appear where you can enter text to explain.
I have a feeling that the answer lies somewhere under "properties" for my combo box but there is so much in there and it''s all over my head. Thanks for any help!
in your properties set all of your fields to visible no then for your combo box on the after update even in properties again you''ll need a good amount of code like this
If me.ComboName = "Realtor" Then
me.name of textbox.visible = True
else
if me.ComboName = "Whatever" Then
me.Whatever.Visible = True
End If
Hope thats what you were trying to do
Thanks for the suggestion!
I tried it but I couldn''t change any of the fields to visible = no. I get an error message that reads "You can''t hide a control that has the focus."
What does that mean?
Ferguson,
First of all, the code readsExpand|Select|Wrap|Line Numbers
这篇关于基于组合框选择的新字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文