Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Fill-In Field displays results twice

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert_L_Ross - 08 Feb 2007 00:52 GMT
I have a fill-in field on a document template that is displaying the results
twice.  Here is my code:
{FILLIN  "Enter the EDFUND Account Number" \o}

I saved the document as a template and it prompts me as expected, but once
I'm done entering my data, it displays it twice.  I.E, if I enter
E12345678
The field displays:
E12345678E12345678

Any ideas what's going on?

Also, I have a drop down box that I want to select then have it update
another field.  I don't want to rely on the 'update fields at print' option
since that is machine-specific...so what kind of macro or code would I write
to have it update another field?

Thanks, any help would be appreciated!!!
Doug Robbins - Word MVP - 08 Feb 2007 12:06 GMT
As you have a drop down box, I assume that you are talking about a dropdown
type formfield in which case you should use a Textbox formfield instead of
the fillin field.

The following can be used to set the value of another formfield based on the
item selected from the drop down in such a form

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name

'

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name

Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value

ActiveDocument.FormFields("Text1").Result = Address

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a fill-in field on a document template that is displaying the
>results
[quoted text clipped - 17 lines]
>
> Thanks, any help would be appreciated!!!
Robert_L_Ross - 08 Feb 2007 16:49 GMT
Doug,

The problem isn't with the drop down portion.  It's with the FillIn field
and it's associated Cross Reference field.  The problem is when my FillIn
field asks me for the value and I enter it...the FillIn field displays my
entry twice, while the Cross Reference field displays it once.  I need to
know why the FillIn field is displaying twice.

> As you have a drop down box, I assume that you are talking about a dropdown
> type formfield in which case you should use a Textbox formfield instead of
[quoted text clipped - 37 lines]
> >
> > Thanks, any help would be appreciated!!!
Jean-Guy Marcil - 08 Feb 2007 17:31 GMT
Robert_L_Ross was telling us:
Robert_L_Ross nous racontait que :

> Doug,
>
[quoted text clipped - 4 lines]
> displays it once.  I need to know why the FillIn field is displaying
> twice.

Select the paragraph that contains the Fill-In field that displays the
double text and do SHIFT-F9 to toggle the field codes,
write back with what you see.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Robert_L_Ross - 08 Feb 2007 18:05 GMT
Jean-Guy...

Brilliant!  There was a hidden field I couldn't find.

So now the last part of this puzzle...the drop down that updates another
field.

I tried Doug's idea, but I keep getting an 'object required' error.  I'll
detail what I did:
Drop Down Box Bookmark name: DOC_TYPE_DROP
Field I want the result to display in Bookmark Name: DOC_TYPE_BAR (it's a
bar code field that will have the 'text' version underneath it - in the
DOC_TYPE_DROP field).

In the DOC_TYPE_DROP field, I set the Exit Macro to run the DOC_TYPE_EXIT
macro.  I copied the VB that Doug sent me and tweaked it to try to match my
field names (I commented the lines I didn't think applied):
Sub DOC_TYPE_DROP_EXIT()
   'Set DOC_TYPE_DROP = ActiveDocument.FormFields("Dropdown1").DropDown
   DOC_TYPE_BAR = DOC_TYPE_DROP.ListEntries(DOC_TYPE_DROP.Value).Name
   'Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value
   'ActiveDocument.FormFields("Text1").Result = Address
End Sub

Any ideas?

THX again guys!

> Robert_L_Ross was telling us:
> Robert_L_Ross nous racontait que :
[quoted text clipped - 11 lines]
> double text and do SHIFT-F9 to toggle the field codes,
> write back with what you see.
Doug Robbins - Word MVP - 08 Feb 2007 19:19 GMT
Not near close enough to what I suggested.  The thing that you want to
appear in a field will need to be saved as an autotext entry.  However, if
it is a graphic of some sort, you probably can't get it to be displayed in a
formfield which is what the code is designed to do and you may need to
create a bookmark in your document into the .Range of which the item can be
inserted.  That however will require that code be included to unprotect and
then re-protect the form.

I think that you probably should be considering the use of a userform rather
than a protected document with formfields.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Jean-Guy...
>
[quoted text clipped - 41 lines]
>> double text and do SHIFT-F9 to toggle the field codes,
>> write back with what you see.
Robert_L_Ross - 08 Feb 2007 21:32 GMT
Doug,

I am using a userform...I'm inserting fields, protecting the document and
saving it as a .dot.  ...maybe I'm not explaining it correctly.

I opened a new document.
Put in a drop down box that has a list of items I want the user to choose
from.
Put in a reference field to that drop down box.
Changed the font of the reference field to a bar code font (not image).
Set up other 'fill in' fields.
Protected the document for forms.
Saved as a .dot

Now, when I open the document, the fill-in fields kick off, asking the user
for various information.  They finish entering the information and the form
updates, displaying the information correctly (the reference field that uses
the bar code font for some reason scans with a non-printing square at the
end, but our guys say that's ok).

I have the reference fields all working correctly and life is good, except
for one thing.  I need a way to ask for a 2 digit code before any of the fill
in fields are launched...or after the fields are completed.  I currently
house the 2 digit code in the drop down box...so the user has to select that
last.  The only problem is when the user selects it in a userform, the only
way to update the associated bar code reference field is to set the drop down
box to 'calculate on exit'...and that makes ALL the fields ask for info.  I
need this field to limit to 2 characters and only specific combinations
(otherwise when the bar code reference field is scanned, it will return an
invalid code and the scanner will stop).

So what I'm asking is how do I do one of two things:
1. Get the drop down field to update the reference field (or any text field
for that matter) after selecting a value but NOT making the rest of the 'fill
in' fields launch.  I immediately thought of a drop down because I can limit
the entries the user can return.
2. Get an Input box to somehow automatically launch (either before or
immediately after the 'fill in' fields) but limit it to just 2 character
combinations that I can validate.

From what I understand, you can limit the data in an input box by either the
format of the box or by a vb check of the resulting data.  

> Not near close enough to what I suggested.  The thing that you want to
> appear in a field will need to be saved as an autotext entry.  However, if
[quoted text clipped - 52 lines]
> >> double text and do SHIFT-F9 to toggle the field codes,
> >> write back with what you see.
Doug Robbins - Word MVP - 09 Feb 2007 22:34 GMT
Use Text formfields instead of fill-in fields.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Doug,
>
[quoted text clipped - 118 lines]
>> >> double text and do SHIFT-F9 to toggle the field codes,
>> >> write back with what you see.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.