How do I write code for ... If this field is blank, Then go to X F

M

M1chelle

and alternatively, if X field is "anything", then go to 1 Field?

I'm trying to make this as simple as I can. After five hours of trying to
figure this out, I'm desperate. I'm trying (for the first time) to use VB to
create a template for a Preprinted Purchase Order form I have. I've scanned
the form into Word 2003 and using Tables, I've created the needed Form
Fields. I've renamed the formfields for ease determination of what's what...

I need to say, IF BkAcct1 = "Blank", then Goto BkQty1. If not blank, it
needs to go to BKAcct2.

Can Anyone PLEASE Help me???
(e-mail address removed)
Thanks,
 
G

Greg Maxey

Run something like the following as an on exit macro from BkAcct1

Sub ScratchMarcro()
Dim oDoc As Document
Set oDoc = ActiveDocument
If oDoc.FormFields("BkAcct1").Result = "" Then
Selection.GoTo What:=wdGoToBookmark, Name:="BkAcct2"
Else
Selection.GoTo What:=wdGoToBookmark, Name:="BkQty1"
End If
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