Quantcast
Channel: Forum Posts
Viewing all articles
Browse latest Browse all 614

Error when using Find button on a "Tree" field

$
0
0

Hi community,

 

A "tree" field is filled with a txt file by a VB script; this works well but when I push on the FIND button, I've got this error (Picture in attach)

 

 

The VBS:

Option Strict Off

Imports System
Imports System.IO
Imports Kyocera20Capture.Workflow
Imports microsoft.VisualBasic


Module Script
    Sub Form_OnLoad(ByVal eventData As MFPEventData)
		
		Dim ListYear As ListField
		Dim MyYear As String
		ListYear = eventData.Form.Fields.GetField("Year")
		
		MyYear = Year(Now)
		ListYear.Value = MyYear
		
				
		Dim sFileName As String
		Dim srFileReader As StreamReader
		Dim sInputLine As String
		Dim TreeTest As TreeField
		
		Try
		
		TreeTest = eventData.Form.Fields.GetField("Providers")
		TreeTest.RootNode.Nodes.Clear()
		
		TreeTest.Value = "Providers"
		TreeTest.ValueForDisplay = "Providers"
				
		sFileName = "C:\ProvidersList.txt"
		srFileReader = File.OpenText(sFileName)
		sInputLine = srFileReader.ReadLine()
		
	
		Do Until sInputLine Is Nothing
			sInputLine = srFileReader.ReadLine()
			'console.writeline(sInputLine)
			TreeTest.RootNode.Nodes.Add(New TreeItem(sInputLine,sInputLine))
			
		Loop
		
		
		Catch ex As Exception
			Console.WriteLine(ex.Message)
		End Try

		
	End Sub
	

End Module


Thanks for your help :-)

 

Ludo.

Attached Images

  • Error.png

Viewing all articles
Browse latest Browse all 614

Trending Articles