Dim Tx As WinForm.DropDownBox = e.Sender
If Tx.Text.Length = 6 Then
If Tables("销售订单").Rows.Count = 0 Then
Tables("销售订单").AddNew()
Dim r1 As Row = Tables("销售订单").Current
e.Form.Controls("卡号").Text = "会员卡号:" & r1("会员卡号")
e.Form.Controls("姓名").Text = "姓名:" & r1("姓名")
e.Form.Controls("折扣").Text = "折扣:" & r1("折扣")
Dim dr As DataRow = DataTables("会员资料").Find("会员卡号='" & r1("会员卡号") & "'")
If dr IsNot Nothing Then
e.Form.Controls("积分").Text = "积分:" & dr("积分")
End If
e.Form.Controls("销售单号").Text ="销售单号:" & r1("销售单号")
e.Form.Controls("操作员").Text ="操作员:" & r1("操作员")
e.Form.Controls("销售日期").Text ="销售日期:" & r1("销售日期")
Else
Forms("主界面").Controls("卡号").Text = "会员卡号:"
Forms("主界面").Controls("姓名").Text = "姓名:"
Forms("主界面").Controls("折扣").Text = "折扣:"
Forms("主界面").Controls("积分").Text = "积分:"
Forms("主界面").Controls("销售单号").Text ="销售单号:"
Forms("主界面").Controls("操作员").Text ="操作员:"
Forms("主界面").Controls("销售日期").Text ="销售日期:"
End If
If Tables("销售订单.销售明细").Rows.Count > 0 Then
Dim r1 As Row = Tables("销售订单.销售明细").AddNew
r1("商品编号")= Tx.Text
Tables("销售订单.销售明细").DataTable.DeleteFor("商品编号 Is Null")
r1.save()
Tx.Text= Nothing
Dim dr As Row = Tables("销售订单").Current
Dim i As Integer = Tables("销售订单.销售明细").DataTable.Compute("Count(销售单号)","销售单号='" & dr("销售单号") & "'")
Dim n1 As Double = Tables("销售订单.销售明细").DataTable.Compute("Sum(售价小计)","销售单号='" & dr("销售单号") & "'")
Forms("主界面").Controls("销售小计").Text = "销售数量:" & i & "笔" & " " & "合计金额:" & n1 & "元"
Forms("主界面").Controls("销售合计").Text = "共" & n1 & "元"
Else
Forms("主界面").Controls("销售合计").Text = "共0元"
Forms("主界面").Controls("销售小计").Text ="消费数量:0 笔 合计金额:0元"
End If
End If
红色部分,不让数值等于6才能识别商品,输入任意敲回车输入,该怎么改写,一直看不明白