Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#Error calling module in a report

Status
Not open for further replies.

timhulio

Programmer
Nov 28, 2001
1
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top