Object variable or with block variable not set

Hi,

I'm a java developer trying to write some VB code to access a Java API I have written. I am getting this error when I try to call a method on the API.

I have included the code below.

thanks in advance for any help.

-

Dim vResult As java_util_Vector

Dim SearchResult As SearchFile2

Dim firstName As String

Dim lastName As String

Dim strResult As String

Private Sub Search_Click()

firstName = eIndex.fName.Text

lastName = eIndex.lName.Text

Set vResult = SearchResult.nameSearch(firstName, lastName)

strResult = vResult.elementAt(1)

MsgBox strResult

End Sub

[683 byte] By [knoxor] at [2007-9-26 1:48:47]
# 1

This error is essentially the same as a NullPointerException. Either vResult is nothing after the set statement or there is no element at 1.

You can check by ...

If not vResult is nothing Then

strResult = vResult.elementAt(1) '-- You may need to use 0 for first element

else

strResult = "Nothing found"

end if

mnutty at 2007-6-29 2:52:34 > top of Java-index,Desktop,Deploying...