修改代码
static flag As Boolean = False
If e.sender.text.length > 3 AndAlso flag Then
If e.sender.text(0) = "0" And e.sender.text(1)="1" Then
e.Form.controls("TextBox4").text = "J18A1"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) ="0" And e.sender.text(1)="2" Then
e.Form.controls("TextBox4").text = "J18A2"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "0" And e.sender.text(1)="3" Then
e.Form.controls("TextBox4").text = "J18C"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "0" And e.sender.text(1)="4" Then
e.Form.controls("TextBox4").text = "J18B"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) ="0" And e.sender.text(1)="5" Then
e.Form.controls("TextBox4").text = "J48A"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "0" And e.sender.text(1)="6" Then
e.Form.controls("TextBox4").text = "J48B"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "1" And e.sender.text(1)="1" Then
e.Form.controls("TextBox4").text = "J18A3"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) ="1" And e.sender.text(1)="2" Then
e.Form.controls("TextBox4").text = "J18BX"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "1" And e.sender.text(1)="3" Then
e.Form.controls("TextBox4").text = "J58A"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "0" And e.sender.text(1)="7" Then
e.Form.controls("TextBox4").text = "SD608"
' e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) ="0" And e.sender.text(1)="8" Then
e.Form.controls("TextBox4").text = "JC609"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "0" And e.sender.text(1)="9" Then
e.Form.controls("TextBox4").text = "NES809"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "1" And e.sender.text(1)="0" Then
e.Form.controls("TextBox4").text = "PC708"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "1" And e.sender.text(1)="4" Then
e.Form.controls("TextBox4").text = "PC708A"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) ="1" And e.sender.text(1)="5" Then
e.Form.controls("TextBox4").text = "PC708R"
e.Form.controls("TextBox4").WriteValue
End If
If e.sender.text(0) = "1" And e.sender.text(1)="6" Then
e.Form.controls("TextBox4").text = "DB1207"
e.Form.controls("TextBox4").WriteValue
End If
End If
If e.sender.text.length > 9 AndAlso flag Then
e.Form.controls("TextBox1").text = e.sender.text.Substring(2,8)
e.Form.controls("TextBox1").WriteValue
End If
flag = True