View Full Version : Repeate text fields, labels and more depending on a combo box
will1128
09-17-2010, 02:18 PM
I have a form in which I would like to place a combo box that when a user selects a number out of it draws a bunch of text boxes, lables and radio buttons.
I've tried using AutoText, but then I seem to lose the value of comboboxes. I'm not sure how to use a Template. I've attached my example.
Any ideas on what would be good way to start?:bug:
Tinbendr
09-17-2010, 02:38 PM
It's easier to build what you need, then 'hide/unhide' that parts you want with Font.Hidden = True/False.
You're example doesn't have a combobox in it.
David
fumei
09-20-2010, 09:40 AM
Comboboxes insert via AutoText are empty.
"I have a form in which I would like to place a combo box that when a user selects a number out of it draws a bunch of text boxes, lables and radio buttons. "
As you do not have a combobox it hard to know what to do, and especially as you make no mention of WHERE this " bunch of text boxes, lables and radio buttons" is supposed to go.
At the start of the document? At the end? In the header? In the footer? Right after the combobox...which is not there? BEFORE the combobox that is not there?
However, again, ActiveX comboboxes inserted by ANY means do not retain values. They must be individually populated.
will1128
09-22-2010, 07:40 AM
David,
How do you use Font.Hide = True/False? I can see it in the Format box, but I don't understand.
Tinbendr
09-22-2010, 08:03 AM
I have a form in which I would like to place a combo box that when a user selects a number out of it draws a bunch of text boxes, lables and radio buttons.
Answer a few questions before we proceed.
When you say a 'user select a number', are you asking the user how many drop downs they want, or is this a collection of dropdown, textboxes, and radio buttons per number?
What do you mean, 'lose the value of comboboxes'? Comboboxes don't store any information. You have to repopulate everytime at runtime. So, do the comboboxes have a fixed list in them? For example, each line item of objects need to have the same selection?
Could you ask for a number, then cycle through them, showing only one at a time?
If you could be a bit more descriptive about your form, then we might be able to better answer your original question.
fumei
09-22-2010, 11:31 AM
1. It is Font.Hidden, not Font.Hide
' example 1 - hides paragraph 1
ActiveDocument.Paragraphs(1).Range.Font.Hidden = True
' example 2 - hides Table 2
ActiveDocument.Tables(2).Range.Font.Hidden = True
Hidden is a property of Font, a property of Range. Get the range of something (the selection, a paragraph, a header, a table...anything with a range - just about everything) and make its font.hidden = True.
2. ALL hidden text is visible (even if it is True) if the Show/Hide button is clicked on the toolbar.
Your original statement: "I've tried using AutoText, but then I seem to lose the value of comboboxes. I'm not sure how to use a Template. I've attached my example."
You can use AutoText, but you must populate your comboboxes - like all comboboxes.
You may also want to answer my question of where you want to insert this stuff.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.