S
Simon Ransom
Hello
I am trying to validtae that a field has a value more than 1. I am using
the following code from the word.mvps.org site. Works correctly for any
numbers 0 through 9 but does not work for 10, 11, 20, 21 etc. Obviously due
to some issue with the number of digits that it is checking but i am not
familiar enough to work it out...
==================
Sub ExitTotalPages()
With ActiveDocument.FormFields("fTotalPages")
If Len(.Result) > 0 And Right$(.Result, 1) < "2" Then
Application.OnTime When:=Now + TimeValue("00:00:01"),
Name:="GoBacktoTotalPages"
MsgBox "Please ensure that you have entered the correct Total
Number of Pages for your Purchase Order, the value of 1 cannot be correct!"
End If
End With
End Sub
============================
Sub GoBacktoTotalPages()
ActiveDocument.Bookmarks("fTotalPages").Range.Fields(1).Result.Select
End Sub
============================
Any input much appreciated
Simon
I am trying to validtae that a field has a value more than 1. I am using
the following code from the word.mvps.org site. Works correctly for any
numbers 0 through 9 but does not work for 10, 11, 20, 21 etc. Obviously due
to some issue with the number of digits that it is checking but i am not
familiar enough to work it out...
==================
Sub ExitTotalPages()
With ActiveDocument.FormFields("fTotalPages")
If Len(.Result) > 0 And Right$(.Result, 1) < "2" Then
Application.OnTime When:=Now + TimeValue("00:00:01"),
Name:="GoBacktoTotalPages"
MsgBox "Please ensure that you have entered the correct Total
Number of Pages for your Purchase Order, the value of 1 cannot be correct!"
End If
End With
End Sub
============================
Sub GoBacktoTotalPages()
ActiveDocument.Bookmarks("fTotalPages").Range.Fields(1).Result.Select
End Sub
============================
Any input much appreciated
Simon