I want to create a calculated field that takes two other integer fields in the table, RBeginn and RLength, and creates a string containing a sequence of numbers.
For example, if RBeginn is -2, and RLength is 6, the string should contain "-2,-1,0,1,2,3".
I've already created a function in a module as follows
But when I enter this into the calculated field as seqReturn(RBeginn, RLength) it tells me the function cannot be used in the calculated field.
For example, if RBeginn is -2, and RLength is 6, the string should contain "-2,-1,0,1,2,3".
I've already created a function in a module as follows
Code:
Public Function seqReturn(RBeg As Integer, RLen As Integer) As String
Dim counter As Integer
Dim RSeq As String
RSeq = RBeg
For counter = RSeq + 1 To RSeq + Nz(RLen, 2) - 1
RSeq = RSeq & ", " & counter
Next counter
seqReturn = RSeq
End Function
But when I enter this into the calculated field as seqReturn(RBeginn, RLength) it tells me the function cannot be used in the calculated field.