Which field did I exit...

J

jkitzy

I am building a very complex form and need some assistance...

In this form, I use sections to hide/show mulitple repeated sections within
the form. Users click +/- buttons to add (unhide) or delete (clear all fields
and hide) these sections. No problem. Works great.

Within each section, use a scheme to differentiate my fields. Each section
has ~40 fields. One of these is a drop-down field (not activeX) used to make
a choice. Based on the choice, I want several fields to change. It's a form
with rates, so I need different information if Fixed or Variable are chosen
in the drop-down, which I call CR1_RD (the 1 indicates the section).

I want this field to fire off an exit macro to enter different information
into other fields in that section based on its value. I'd like to not
duplicate code for each section by capturing the field name that fires the
exit macro.

The only missing piece in my brain for this is, on an exit macro, how do I
capture the section number or field name that fired it?

Thanks!
 
G

Greg Maxey

Sub DDOnExit()
MsgBox "Section: " & Selection.Information(wdActiveEndSectionNumber) & _
" " & Selection.FormFields(1).Name
End Sub
 

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