Revisiting FormFields

K

Ken McLennan

G'day there One & All,

This is my first post to this NG as I'm just starting to work with
Word. I'm not a programmer, but I'm the closest thing to one in my
department. I've successfully built an application or two in VBA for
Excel, but this is my first foray into VBA & Word. Oddly enough, I've
found that Word & Excel are different =).

Be that as it may, I've searched the archives on Google Groups for
an answer to my problem and although I've come close to what I'm trying
to do I've not found an answer that I can build on.

I have 2 columns of FormFields to hold worker's shift start &
finish times on a roster. What I want to do is have the a macro add 8
hours to the first time & enter it into the second. Simple, I would have
thought. There are only ever going to be 6 to 10 staff members, so I
could have individual procedures but that seems totally crappy.

Is it possible to refer to the "calling" field in such a way that
I can use a single generic procedure for all fields. With great
imagination I've entitled the pairs of fields thusly:

fldShft01 - fldShft01a
fldShft02 - fldShft02a
fldShft03 - fldShft03a

Hence I'm trying to write a single set of code that will add 8
hours to the value entered into the left side field, and then enter that
in the right side field. However I can't see how to refer to the name of
the field in the left column without explicitly naming it in the code.

I'm sure this sort of thing has cropped up before. There are near
misses in the archives, but the closest one I found had only a few
comments with most of the code excised so I couldn't even adapt what was
there.

Can someone point me in the right direction please?
In any case I'm off to seek a few MVP websites to see what I can see.

Thank you
Ken McLennan
Qld Australia
 

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