T
tighe
this one is bit odd:
Originally I had a Form in a Word Document, you select the Check box for a
state on the form. Each state has a bookmark, usually a couple pages worth
of text. when you run the code all bookmarks unchecked state bookmarks were
deleted:
If State() = False Then
Selection.GoTo What:=wdGoToBookmark, Name:="State"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.Delete Unit:=wdCharacter, Count:=1
End If
I tried moving it into the code in Access 2007 to run when it opens, since
it is a merge document. i changed the code in word to access:
If Forms![StateForm]![State] = "State" And Forms![StateForm]![Status] <>
"Working" Then
Selection.GoTo what:=wdGoToBookmark, Name:="State"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.Delete Unit:=wdCharacter, Count:=1
End If
the code runs but it deletes everything no matter what i change the "If"
criteria to. also the form is continuous.
thanks for the help in advance.
Originally I had a Form in a Word Document, you select the Check box for a
state on the form. Each state has a bookmark, usually a couple pages worth
of text. when you run the code all bookmarks unchecked state bookmarks were
deleted:
If State() = False Then
Selection.GoTo What:=wdGoToBookmark, Name:="State"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.Delete Unit:=wdCharacter, Count:=1
End If
I tried moving it into the code in Access 2007 to run when it opens, since
it is a merge document. i changed the code in word to access:
If Forms![StateForm]![State] = "State" And Forms![StateForm]![Status] <>
"Working" Then
Selection.GoTo what:=wdGoToBookmark, Name:="State"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.Delete Unit:=wdCharacter, Count:=1
End If
the code runs but it deletes everything no matter what i change the "If"
criteria to. also the form is continuous.
thanks for the help in advance.