Sub edtAWBLoadScan_TextChanged (Old As String, New As String)
If New.Length = 12 Then
Dim awb As String
awb = New.SubString2(0,11)
' pull the rest of the data from table
Dim m As Map
m = DBUtils.ExecuteMap(SQLLite, "SELECT rnd_pk, rnd_rnhfk, rnd_awbfk, awb_number, awb_pieces, cus_number,cus_company FROM RunSheetDetails WHERE awb_number = ?", Array As String(awb))
If m = Null OR m.IsInitialized = False Then
Msgbox("You have scanned/entered an Incorrect AWB#","Incorrect AWB#")
Else
'other code
End If
End If
End Sub