G
Greg Maxey
For some unexplained reason I am starting to get
Microsoft Visual Basic
Run-time error "6124"
You are not allowed to edit this region because document protection is in
effect>
I open a new document and enter a four column single row table. I put a
text field in the first cell, a check box in the second and third cell. All
are set to run the following macro on exit. When I tab out of the any of
the fields the error above is generated and the debugger highlights the
following line:
ActiveDocument.Tables(1).Cell(1, 4).Range = Val1 + Val2 + Val3
Sub SumFormFields1()
Dim Val1 As Integer
Dim Val2 As Integer
Dim Val3 As Integer
Val1 = Val(ActiveDocument.FormFields("Text1").Result)
With ActiveDocument
If .FormFields("Check1").Result = True Then
Val2 = 20
Else: Val2 = 0
End If
If .FormFields("Check2").Result = True Then
Val3 = 40
Else: Val3 = 0
End If
ActiveDocument.Tables(1).Cell(1, 4).Range = Val1 + Val2 + Val3
End With
End Sub
Can anyone help explain why this is happening and how to fix it? Thanks.
Microsoft Visual Basic
Run-time error "6124"
You are not allowed to edit this region because document protection is in
effect>
I open a new document and enter a four column single row table. I put a
text field in the first cell, a check box in the second and third cell. All
are set to run the following macro on exit. When I tab out of the any of
the fields the error above is generated and the debugger highlights the
following line:
ActiveDocument.Tables(1).Cell(1, 4).Range = Val1 + Val2 + Val3
Sub SumFormFields1()
Dim Val1 As Integer
Dim Val2 As Integer
Dim Val3 As Integer
Val1 = Val(ActiveDocument.FormFields("Text1").Result)
With ActiveDocument
If .FormFields("Check1").Result = True Then
Val2 = 20
Else: Val2 = 0
End If
If .FormFields("Check2").Result = True Then
Val3 = 40
Else: Val3 = 0
End If
ActiveDocument.Tables(1).Cell(1, 4).Range = Val1 + Val2 + Val3
End With
End Sub
Can anyone help explain why this is happening and how to fix it? Thanks.