×
Menu
Index

3.6.2.5. Validating a Field Using an External Database

 
Add this script to the OnValueChanged property:
 
 
Set MyDB = ChronoApp.GetChronoScanDBConnection("MyDatabase", "", "")
 
' Build your SQL Query
SQLString = "Select * from Suppliers where AccountRef = '" & UserField_Document_Type.value & "'"
 
Set rsCustomers = MyDB.Execute(SQLString)
 
If Not rsCustomers.EOF Then
    UserField_Document_Type.ValidateStatus = 1
Else
    UserField_Document_Type.ValidateStatus = 0   
End If
 
 
 
 
Notes:
MyDatabase - A database connection created on the adminitration tab
Suppliers - The table on the remote database
AccountRef - The column on the remote database
UserField_Document_Type - The script name of the ChronoScan field you want to validate.