EnterKey Macro

T

TomD

I've created an invoice as a template and implemented the
EnterKey macro (KB211219). Everything appears fine in
operation but I've noticed the following anomoly.....

Two columns, one "quanity" the other "price". the format
of quantity is numeric to one decimal place e.g 274.0
The format of rate is sterling to two decimal places and
leading currency symbol e.g. £1.82.

Now, navigation......

In quantity cell, input 274, "tab" key to rate cell,
quanity shows 274.0

In rate cell, input 1.82, "tab" key to next cell
("amount"), rate cell shows £1.82. All as expected in
terms of format. However if I use the "Enter" key
instead of "Tab", I do not get the expected format i,e
input 274 get 274, input 1.82 get 1.82

How do I get format to show using "Enter Key????
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Tom,

Try running a macro on exit from the fields that uses

ActiveDocument.Formfields("bmname").Result =
Format(ActiveDocument.Formfields("bmname").Result, "#.0")

If the macro does not get fired by the exit via the Enter Key, have it run
on entry to the next formfield.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
I've created an invoice as a template and implemented the
EnterKey macro (KB211219). Everything appears fine in
operation but I've noticed the following anomoly.....

Two columns, one "quanity" the other "price". the format
of quantity is numeric to one decimal place e.g 274.0
The format of rate is sterling to two decimal places and
leading currency symbol e.g. £1.82.

Now, navigation......

In quantity cell, input 274, "tab" key to rate cell,
quanity shows 274.0

In rate cell, input 1.82, "tab" key to next cell
("amount"), rate cell shows £1.82. All as expected in
terms of format. However if I use the "Enter" key
instead of "Tab", I do not get the expected format i,e
input 274 get 274, input 1.82 get 1.82

How do I get format to show using "Enter Key????
 

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