Anthony904
IS-IT--Management
I have a word document with some form fields..
I have a function that acts as a lookup table for several form fields..
Function Testing(iLevel As Integer) As Integer
Select Case iLevel
Case 0
Testing = 5
Case 1
Testing = 5.16
Case 2
Testing = 5.32
Case 3
Testing = 5.48
Case 4
Testing = 5.64
Case 5
Testing = 5.8
Case 6
Testing = 5.98
Case 7
Testing = 6.16
Case 8
Testing = 6.34
Case 9
Testing = 6.52
Case 10
Testing = 6.7
Case Else ' Other values.
Testing = 0
End Select
End Function
-----------
and I'm retrieving like so..
Function Retrieve()
ActiveDocument.FormFields("Text1").Result = Testing(ActiveDocument.FormFields("Text2").Result)
End Function
.............
When I test the code I'm getting a data type mismatch run-time error 13...
The bold is where the error points to..
Does anyone see why I'm getting this error? and how to fix it..
Thanks!
I have a function that acts as a lookup table for several form fields..
Function Testing(iLevel As Integer) As Integer
Select Case iLevel
Case 0
Testing = 5
Case 1
Testing = 5.16
Case 2
Testing = 5.32
Case 3
Testing = 5.48
Case 4
Testing = 5.64
Case 5
Testing = 5.8
Case 6
Testing = 5.98
Case 7
Testing = 6.16
Case 8
Testing = 6.34
Case 9
Testing = 6.52
Case 10
Testing = 6.7
Case Else ' Other values.
Testing = 0
End Select
End Function
-----------
and I'm retrieving like so..
Function Retrieve()
ActiveDocument.FormFields("Text1").Result = Testing(ActiveDocument.FormFields("Text2").Result)
End Function
.............
When I test the code I'm getting a data type mismatch run-time error 13...
The bold is where the error points to..
Does anyone see why I'm getting this error? and how to fix it..
Thanks!