Getting recordset from Webservice

F

Flokkie

I have an Acces2003 app. I call an webservice to fill a listbox. That works
fine. (See code below)
I know want to have the records in a (continuous) form.
How do I create a recordset form the webservice??


Private Sub txtCustno_AfterUpdate()
On Error GoTo HandleErrors
' Reset the list box.
lstProducts.RowSource = vbNullString
DoCmd.Hourglass True

' Retrieve the data.
Dim objProducts As clsws_Service1
Set objProducts = New clsws_Service1

Dim products As MSXML2.IXMLDOMNodeList
Set products = objProducts.wsm_GetContactsArray(Me.txtCustno.Value)

' To see the XML returned, browse to this site:
'
http://www.mcwtech.com/northwinddata/products.asmx/GetProductsByCategory?CategoryID=1

' Node 0 contains schema; Node 1 contains the data.
Dim items As MSXML2.IXMLDOMNodeList
Set items = products.item(1).selectNodes("//CUSTNO")

' Loop through all the items, retrieving the
' UnitsInStock field (in addition to the already retrieved
' ProductName field).
Dim item As MSXML2.IXMLDOMNode
For Each item In items
lstProducts.AddItem item.Text & ";" & _
item.parentNode.selectSingleNode("C_NAME").Text
Form_Formulier2.CUSTNO.Value = item.Text
Next item

ExitHere:
DoCmd.Hourglass False
Exit Sub

HandleErrors:
MsgBox Err.Description
Resume ExitHere

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top