Share via

How to Hide Error Message

Anonymous
2013-05-29T18:04:39+00:00

I am creating a application form for an insurance company.  When a new location is needed on the form, I have created a building block that they input into the form and continue to fill in the appropriate fields (there are approximately 20 fields), which I have set as content controls.  

At the top of the form I created a table that is a summary of all locations (ie, Location Name, Address, Type of Business), and these fields are styled Location1, Location2, Address1, addresss2, etc, I put the Styleref field code in the summary table to mapped the codes, (b/c I don't know another way to make this work using building blocks), but if a building block is not in use, therefore, the Style is not, and I get an error in the summary table.

Is there a way to hide the error until the Building block (Styles) are inserted, or is there a better way to populate the summary table?

They only want to see locations as they are used, so not to have a big form of empty locations.

Any help on populating this form as content is entered would be so helpful.

Thanks,

Juanita

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2013-05-30T12:53:18+00:00

    Thanks Doug.

    I guess I just may go the route of VBA.  I tried the StyleRef had it all set up and when I went to test it, nothing happened.  So My!!!

    Regards,

    Juanita Hiscock

    VBA Wantabe

    Was this answer helpful?

    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2013-05-29T22:18:18+00:00

    I would make use of a UserForm with a combobox that was populated with the locations and a button that allowed to user to create a new location.

    See the following pages of Greg Maxey's website :

    http://gregmaxey.mvps.org/Create\_and\_employ\_a\_UserForm.htm

    http://gregmaxey.mvps.org/Populate\_UserForm\_ListBox.htm

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-05-29T18:47:48+00:00

    I Think I will try this solution from  Suzanne S. Barnhill.

    http://wordfaqs.mvps.org/StyleRef.htm#Suppressing

    Suppressing a StyleRef field

    As we have seen above (Caveat #4), Hidden formatting is the only font formatting that a StyleRef field picks up. You can use this to your advantage, however, in combination with the default behavior of StyleRef fields:

    1. On any given page, a StyleRef field in a header or footer will pick up the first text on the page that is formatted with the referenced style.
    2. If there is no text on the page formatted with that style, it will look for the last previous text in that style.

    What this means for you is that if you have a heading on one page that you want picked up in the headers on subsequent pages but not on the page where it appears, you can accomplish this in one of two ways:

    1. You can precede the heading with an empty, Hidden paragraph in the same style. On the first page, Word will pick up the empty paragraph (it doesn’t actually have to be Hidden as long as it’s empty, but it will need to be Hidden if you don’t want it to take up space). This will work for either paragraph or character styles.
    2. You can include some Hidden text at the beginning of the heading and apply the referenced style to it. This will require a character style applied carefully. As we saw in Caveat #3 above, Word will pick up only the first portion of text formatted with the character style, so you will need to insert at least two characters, format both as Hidden, and format the first with your referenced style. Then format the rest of the paragraph with the character style. Note: Be careful not to include the final paragraph mark in the character style; see Caveat #2 above.

    Important Note: As noted in (1) above, an empty paragraph in the referenced style will be picked up by the StyleRef field. If you ever experience problems with missing text in a header or footer that contains a StyleRef field, look for these empty paragraphs. It is helpful to display nonprinting characters, and you can also use the Find dialog to search for the referenced style. One place you may not think to look is in tables: keep in mind that the end-of-cell marker (¤) functions the same as a paragraph mark. If there is a paragraph break before the end of the cell, then an empty paragraph has been created.

    Was this answer helpful?

    0 comments No comments