Thread: [Solved] Help with if then statements
View Single Post
 
Old 07-19-2015, 11:58 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the attached. For your template, you will require all of the included code instead of what you now have for your 'TabbedCensus1790To1940Macro' and 'LockDD1' macros. I've also commented-out the .ExitMacro = "UnlinkFields" line in the code for testing purposes (plus that macro isn't in the code I'm returning).

As you will see, a complete re-write of your code was required. The code should now give you a good idea of how to use macros for conditional text & formfield insertion at nominated bookmarks. Note, too, that I've eliminated all of your IF fields. Given the need to conditionally insert multiple formfields, it didn't make sense having some of the processing done that way and the balance via macro coding when the latter handles the lot quite seamlessly.
Attached Files
File Type: docm Census.docm (40.8 KB, 31 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote