View Single Post
  #2   Report Post  
Posted to microsoft.public.word.tables
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Formula for non blank cell

Hi Penny,

This is probably best handled by referencing the formfield's bookmark, rather than the cell. That way the calculation isn't affected
by a change in table layout. Also make sure the formfield's properties are set to 'calculate on exit'.

In A1, you could then use a formula field coded like:
{IF{REF BkMrk}= "BkMrk_Default" "{CREATEDATE \@ "yyyy-MM-dd" \@ "HH:mm:ss"}" "Result if BkMrk not Default"}
whe
.. BkMrk is the formfield's bookmark name.
.. BkMrk_Default is whatever the formfield has before being filled in. If it's the default space sequence, use " *" to trap any
sequence beginning with a space (in case the user simply hits the spacebar one or more times then tabs out of the field)
.. if there's nothing to display if the user enters nothing in the formfield, you can delete "Result if BkMrk not Default" in its
entirety.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[MVP - Microsoft Word]


"Penny Miller" wrote in message ...
I hope this makes sense... I'm working with a department that uses word to keep track of when employees are doing their designated
duties by system date/time to make sure they aren't fudging the time.

I've created a document that has two different tables in it and the first table (7 columns) can be un protected with no worries.
However, the second table (2 columns) needs to have cell A1 protected and if a user keys in any text in B1 I need it to add the
current date/time to A1 once they hit the enter/tab key.

If B1 isnot blank then A1=CREATEDATE \@ "yyyy-MM-dd" \@ "HH:mm:ss"

Thanks