Button search - resource ID

Hi,

I am trying to add code to search for the resource as a filter on the Priority Dispatch report. Below is my code - which compiles OK, but I get "object reference not set to an instance of an object" error. Can anyone help?


Private Sub btnRescourceIDList_Click(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles btnRescourceIDList.Click
'// ** Place Event Handling Code Here **
Dim myVA As ResourceAdapter = New ResourceAdapter("Resource Search")
myVA.BOConnect()

Dim MorePages As Boolean

Dim opts AS SearchOptions = New SearchOptions(SearchMode.AutoSearch)
'//opts.NamedSearch.WhereClause.Add()
Dim myDS as Data.DataSet = myVA.GetList(opts, morePages)

myVA.Dispose()
End Sub