Hi,
I've got a function in a module, as follows:
Function xg_GetWordsTim(sMain As String, s1 As String, s2 As String) As String
On Error Resume Next
Dim iStart As Integer, iEnd As Integer
iStart = InStr(1, sMain, s2) - 20
iEnd = InStr(iStart, sMain, s2)
xg_GetWordsTim = Trim(Mid(sMain, iStart, iEnd - iStart))
End Function
I'm sure this works, but when I try to call this in a report using the syntax:
=xg_GetWordsTim([CCnumber],"B","^"
(CCnumber being the field whos data I want to ammend)
(I'm aware I don't use the variable s1 here)
I just get an #error message in my report.
Does anyone know what's wrong with this? Am I calling the CCnumber field data in the wrong way?
Thanks, Tim Webster
I've got a function in a module, as follows:
Function xg_GetWordsTim(sMain As String, s1 As String, s2 As String) As String
On Error Resume Next
Dim iStart As Integer, iEnd As Integer
iStart = InStr(1, sMain, s2) - 20
iEnd = InStr(iStart, sMain, s2)
xg_GetWordsTim = Trim(Mid(sMain, iStart, iEnd - iStart))
End Function
I'm sure this works, but when I try to call this in a report using the syntax:
=xg_GetWordsTim([CCnumber],"B","^"
(CCnumber being the field whos data I want to ammend)
(I'm aware I don't use the variable s1 here)
I just get an #error message in my report.
Does anyone know what's wrong with this? Am I calling the CCnumber field data in the wrong way?
Thanks, Tim Webster