Checkboxes to generate letter - vba

I am currently building a User form for some letters we use at work and I would like to design the userform to generate the letter with mostly just checkboxes. e.g.
Your application cannot be completed until the following is received:
A Statutory declaration providing a statement in regards to your: financial situation
In the above example I would need two checkboxes.
Checkbox 1:
A statutory declaration providing a statement in regards to your:
Checkbox2:
financial situation
I guess the question I am asking is in two parts:
1: How do I get checkboxes to generate text?
2: How do I get multiple checkboxes to generate text against the same bookmark/s?
I may not need a Statutory Declaration, I may need a "certified copy of:" ---"bank details, proof of identity, proof of citizenship"
As you can tell from the user form it's pretty extensive and all the checkboxes in the lower half of the form need to generate text.
Grateful for any advice or direction or resources or anything.

In theory, you might store the text to be inserted in your letter in the Check box's caption property and use code to insert the text into your letter when the box is checked. I think this is cumbersome and recommend that you use the caption for a caption, for example, "Statutory declaration". If it is checked such a paragraph is inserted into the letter, else it is left out.
The required declaration may include one or several of many items. Since you are thinking of check boxes, you could have one for each "bank details", "proof of identity", "proof of citizenship". These selections are very short and could be placed in the caption property. But if the texts are longer or of greatly varying lengths I would recommend the use of text boxes instead. So, if Cbx1 is clicked, the text of Tbx1 is inserted etc.
Alternatively, if only one item is required you might consider a dropdown. Or you might use a list box with multiple choices. In principle, I think that using different systems for different levels of decision making helps the user to find his way through your form. For example, use check boxes to select paragraphs (the full text of which might be shown in adjacent text boxes), and then switch to list boxes, option buttons, dropdowns or check boxes which look completely different to specify the contents of the selected paragraph. All of that detail might as well be hidden until the user has checked its box.

Related

What is the difference between fields and formfields?

in word pressing alt+F9 can display "FieldCodes"
How can I access this programmatically using vba and pair them with the formfields?
You can access the field code by ? Application.ActiveDocument.Fields(1).Code
And you can access the form fields by Application.ActiveDocument.FormFields(1)
But is there any guarantee's about the indices matching?
Can a formfield ever not be a Field? can a Field ever not be a formfield?
Will changing these away from FORMTEXT have any unintended side effects, or are these basically nice and friendly linking id's / display values allowing you to view them and swap between them with ease?
Edit: I've come up with the following to get the fields Code. I'm still unsure if it's a good idea to edit them or not, or what they represent.
Application.ActiveDocument.FormFields(1).Range.Fields(1).Code
Fields are general objects, they can be :
document's properties (built-in or custom),
mailing / mergemail,
calculation,
form fields,
...
A form fields is an field for inputs.
Take a look at the links in the tag info of word-field, there is a lot of interesting things!
And you can access them by their own collections (press F2 in VBE to use Object Browser).
For Fields the general collection is in Application.ActiveDocument.Fields,
but you can find them in a lot of objects (check with Object Browser!).
Take a look at that answer to have an idea of the other objects in which you can find it! ;)
To my knowledge, there is no possibility nest something inside a FormField, like you can do in a Field.
I'm not sure to understand that question :
"Will changing these away from FORMTEXT have any unintended side effects,
or are these basically nice and friendly linking id's / display values
allowing you to view them and swap between them with ease?"
If you want to create a Form that users can fill, you'll need to stick with FormFields.
If you want to display values at specific places in a document, Fields is the way to go.
I'd even suggest Custom Document Properties for a general use, and MergeMail for Mailings. ;)

SSRS report, is there a way to switch templates based on configuration?

I have been googling for a good description of this but am not having much luck. I am pretty new to SSRS reports and I am probably not using the correct terminology here. If someone could point me towards an article that describes this that would suffice.
Basically I want to pull a bit into my report, and based on the value of that bit (or maybe a varchar) I want to render an address in different formats, or add/remove some sections completely form the report. I suspect this is basic functionality but am having trouble finding an example. Any help would be appreciated!
Thanks!
If you have a table/matrix the best place to put stuff like this is in columns that are outside of the detail or any groups at the top of the table. You can merge all the cells and add rectangles to add specific formatting. The neat part about using header columns is they can be hidden and the space used will not be rendered.
Say you have a table and Row1 and Row2 contain different formatting of the same data. If you have a report parameter named ShowFormat1 then you can optionally hide/show the correct row with formatting.
Click Row one and Set its Hidden property to =!Parameters!ShowFormat1.Value
Click Row two and Set its Hidden property to =Parameters!ShowFormat1.Value
The same concept can be applied to all elements if you are not using a table or matrix. Non-repeating controls, Rectangle or Image for example, can be hidden but the space used will still be rendered.

How to create non-exclusive checkboxes with the same name in an Acrobat/PDF form

In Acrobat Professional, I create multiple checkboxes and assign the same name to each checkbox, but a different export value. With this, the checkboxes seem to behave like radio buttons: Acrobat only lets me check one of them. If the first is checked, and I click on the second one, Acrobat unchecks the first one.
If I assign different names to the checkboxes, then they do behave independently. However it would make things easier for my code that fills out the form if the name could be the same. Is it possible to create non-exclusive checkboxes (i.e. real checkboxes) that have the same name in Acrobat?
(For reference, this is the PDF I created: 20110503-exclusive-checkboxes.pdf)
Judging from the PDF Reference, it's impossible to create independent checkboxes with the same name.
In fact, a PDF Viewer should use the name to detect which checkboxes will form a check box field.
See Adobe's PDF Reference, 8.6.3 Field Types, Check Boxes (page 648) for more information.
Use the same name and export value for all your checkboxes and they will checked/unchecked together. Adobe Acrobat supports this, it is also permitted by PDF specification.
Can't be done.
That is the very definition of how you define radio groups in a PDF.
You can have different check boxes "foo.MyCheck", "bar.MyCheck", and so forth, and all are different fields. Different parent fields can have children with the same local name but different fully qualified names. Not a problem.
What is it that you're trying to do, anyway?
Adobe Acrobat versions 8,9 and X allow you to create non-exclusive checkboxes. Although, this allows you to create non-exclusive checkboxes, Orbeon does not recognize these fields.
Once you create the initial checkbox,
Right click the check box and select "Place Multiple Fields..."
http://i.stack.imgur.com/ASj3Q.png
In the Create Multiple Dialog box modify the number of fields needed (down/accross)
http://i.stack.imgur.com/gYOoU.png
Then select the other checkbox properties to modify the Export Values

Best way to select from a list - aren't the two listboxes getting a little old?

How many times have we seen this type of selector:
List Box Selector http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/MoveItemsListBox.jpg
I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of asking them if they would consider adding a component that handles this functionality with a slick UI.
I am thinking that a graphical representation of the objects, and a graphical representation of the listboxes - that would be a more intuitive way to move items around.
Has anyone seen an open source project like this?
If a CheckListBox won't suffice (and it usually will), then the "modern" approach would be to use a ListView or similar component with a "Transfer" column. Render the button inline in that column, one for each row, so that it only takes one click to move an item from one to the other.
You see this everywhere in Vista, usually with hyperlinks as opposed to buttons. Instead of clicking on an item and then choosing an action, you click the action at the item level.
I wouldn't go overboard with slickness as it can impair functionality, but the dual-listbox screen is definitely old-school.
Also, if there's a very large amount of data to manage, it helps to provide a progressive search at the bottom of one or both lists.
I have done this type of selection using (essentially) a single CheckListBox that displays each item as an image. Part of the image looks like a LED, which is on (bright) if the item is selected or off (dark) if it is not selected.
This works well if you have a reasonable amount of data to select from, and also works well in a multi-column format if you can predict that the options will have reasonably similar lengths.
Allow users to drag items in/out of list 2, and also drag to reorder in list2.
(All items dragged out of list2, and dropped anywhere outside the list, get put back into list 1, in their correct place in the list by alphabetical or natural order.)
You can merge the two list boxes into one with the help of groups (LVGF_GROUPID flag): one group for selected and one for not selected.
You can also implement group membership changes with drag-drop between them. This way single drag-drop can move an item into the other group at the appropriate position, saving most/all of the other buttons.
Additionaly the bottom of each group can have one pseudo item with help text (i.e. "Drag items here to...") that is visible only when relevant.

limit selections in a listbox in vb.net

I am creating a web control in vb.net that contains a list box. I know that I am able to choose a selection mode of Single or Multiple, but I am interested in limiting a Multiple selection to a predetermined size. For example preventing a user from selecting more than 3 items.
I have tried adding a Validator to the list box, which might be a way forward, but was wondering if there was a way of changing the selection mode to something a bit different than just the two specified ones.
Any ideas or suggestions would be greatly appreciated
Edit: Unfortunately due to project limitations I am unable to use Javascript on this problem. very annoying I know!
You could try handling one of the SelectedIndexChange events. With multiple selection, each time this event fires you can check how many items have already been selected. If it is more than you want, have the handler deselect the one that was just selected. You could also put up a little red label under the listbox saying "Sorry, no more than [n] selections allowed."
EDIT:
Just noticed you said WEB. Same theory applies, but it would have to be done using Javascript.
On the SelectedIndexChanged event, write a short piece of code that will check the number of selected items and if it is greater than your desired amount, unselect the new selection (or unselect the oldest one, or however you wish this to operate).