Fill-In Field displays results twice

R

Robert_L_Ross

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!!!
 
D

Doug Robbins - Word MVP

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


--
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
 
R

Robert_L_Ross

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.
 
J

Jean-Guy Marcil

Robert_L_Ross was telling us:
Robert_L_Ross nous racontait que :
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.

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.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
R

Robert_L_Ross

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!
 
D

Doug Robbins - Word MVP

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.

--
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
 
R

Robert_L_Ross

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.
 
D

Doug Robbins - Word MVP

Use Text formfields instead of fill-in fields.

--
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top