I feel like such a dummy, but I can't get this simple function to work. I wanted to write a function, called Num2Name, that accepts a value, evaluates it, and returns a string based on the number.
See below:
Public Function Num2Name(ValveNumber)
Select Case ValveNumber
Case "2"
Return 'hypokinetic'
Case "3"
Return 'akinetic'
Case "4"
Return 'dyskinetic'
Case "5"
Return 'aneurysm'
Case "9"
Return 'not well visualized'
Case Else
'do nothing
End Select
End Function
I would call this function like the following:
lTIapicalseptal = Num2Name(Trim(Forms!frmtests.frmBApical!apicalseptal))
thinking it would replace the value of the form field with a string.
Instead I get an error, 'return without gosub', and I'm sure it's a simple syntax issue, but I am stumped.
See below:
Public Function Num2Name(ValveNumber)
Select Case ValveNumber
Case "2"
Return 'hypokinetic'
Case "3"
Return 'akinetic'
Case "4"
Return 'dyskinetic'
Case "5"
Return 'aneurysm'
Case "9"
Return 'not well visualized'
Case Else
'do nothing
End Select
End Function
I would call this function like the following:
lTIapicalseptal = Num2Name(Trim(Forms!frmtests.frmBApical!apicalseptal))
thinking it would replace the value of the form field with a string.
Instead I get an error, 'return without gosub', and I'm sure it's a simple syntax issue, but I am stumped.