Peter .. thanks for your help. I have changed the mask to what you suggested
and played around with it some more. The mask is in the REF field, and the
data is always input via the ASK field.
The problem seems to be the decimal point on the numeric keypad. When I
enter data in the form 9,9 using the comma from the keypad, it is fine ...
the figures come out apropos the mask, ie 9.90 (or in dutch notation 9,90).
however when I use the keypad it seems to read the decimal point as a full
stop and therefore rounds up, so 9,9 would come out as 10,0 and ignore the
format mask.
We use the numeric keypad decimal point for other software with no problems,
but it seems that the code for the numeric pad decimal point must be read
differently to the keypad comma ? Any ideas ?
thanks .. Roger
OK, if your keypads have full stop and comma I can't easily test or suggest
from here. I suppose the only simple thing I would want to test is that
setting the language in the language bar didn't make any difference, but I
doubt if it will.
But if Word is receiving a "." when it needs a ",", the only suggestions I
can make are that you either move to using a VBA Userform or inputbox to
capture the data and transform it, or transform the "." into a "," inside
Word, or format your REF fields using a different technique. The only way I
can think of to do this using fields would be to use a DATABASE field which
may be overkill.
But if you want to try that, a way that should work in both Word 2000 and
later (though 2003 may create difficulties because of its pop-up messages
about SQL) would be the following:
Create a folder (say c:\d ) and an Access .mdb file in it (say d.mdb) with a
table in it (say "t") with a single text field "f" and a single row with "r"
in it. Let's suppose the bookmark your ASK field creates is called "X"
Insert the following nested field code and verify that it works:
{ DATABASE
\d "c:\\\d\\d.mdb"
\c "DSN=MS Access Database;DBQ=c:\\d\\d.mdb;"
\s "SELECT format('{ X }','#.,00 <euro symbol>') FROM `t`" }
There are a number of things to notice about this:
a. the { X } is a Word field, i.e. with the special field braces.
b. the single quotes around "t" in FROM `t` are backwards single quotes,
whereas the other ones are vertical single quotes '
c. the DSN name needs to match the one on your system, which may not use
the English name.
d. there is no \h - having only one column, one row, and no headers in the
result means Word inserts the result without wrapping it up in a table
e. you may to format the "D" of "DATABASE" with the format you need and add
a \*Charformat at the end
f. it seems to work with numbers containing either a . or a , but I suspect
inserting thousands separatos in the ASK field will cause problems.
g. "format" is quite versatile but is different in a number of ways from
the Word field equivalent. The position of the "." is important. Also, if
you want to use the full numeric format facilities (where you can have
formats 'a;b;c;d' for positive, negative, null and zero values) you will
probably need
"SELECT format(cdbl('{ X }'),'#.,00 <euro symbol>') FROM `t`"
h.You may need even more if you want to deal with invalid numbers, but I
leave that up to you.
I've checked this particular version in Word 2003 but not Word 2000 or Word
2002. In Word 2000 it used to be slightly simpler but I wasn't able to make
the old technique work in 2002/2003.
--
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/
> Peter .. thanks for your help. I have changed the mask to what you suggested
> and played around with it some more. The mask is in the REF field, and the
[quoted text clipped - 12 lines]
>
> thanks .. Roger
Roger Ottaway - 23 Jan 2004 13:57 GMT
Peter
thanks. A couple of years ago I had a similar problem with the number 2 on
the numeric keypad giving a different response to the number 2 on the alpha
keypad, they are the same .. but they have different "codes". Perhaps this
is the problem with the decimal point on the numeric keypad versus the comma
on the alpha keypad when using the belgian value notation and dutch version
of WORD. Do you know of any literature on this ?
thanks
Roger
Peter Jamieson - 23 Jan 2004 15:28 GMT
Well, the following seems related but is very specific (Windows NT SP2 or
earlier)
http://support.microsoft.com/default.aspx?scid=kb;en-us;166151
The following article appears to document the fix:
http://support.microsoft.com/default.aspx?scid=kb;en-us;186634
However, my experience here is that numeric keypad "." results in "." in
Word and Notepad on Win2K and WinXPPro even when my regional options specify
a Belgian (Dutch) keyboard layout, but in "," in Excel. So I have to assume
that individual applications are handling this keystroke in different ways.
--
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/
> Peter
>
[quoted text clipped - 8 lines]
>
> Roger
Roger Ottaway - 24 Jan 2004 10:32 GMT
Peter
yes .. it seems to be something that is unique to the Belgian numeric keypad
decimal point/comma and dutch version of WORD, and using code interfacing
with those. The articles you indicate don't give a fix for my particular
problem, but I will search the knowledge base. thanks for your help
Roger