物流运输管理系统 第6页
Next
txtWeight.Text = sys.TextToNum(rs("Weight"))
txtBasicCarriage.Text = sys.TextToNum(rs("BasicCarriage"))
txtLocalCarriage.Text = sys.TextToNum(rs("LocalCarriage"))
txtServeCharge.Text = sys.TextToNum(rs("ServeCharge"))
txtLoadCharge.Text = sys.TextToNum(rs("LoadCharge"))
txtFavourabile.Text = sys.TextToNum(rs("Favourabile"))
txtShortCarriage.Text = sys.TextToNum(rs("ShortCarriage"))
txtStorageCharge.Text = sys.TextToNum(rs("StorageCharge"))
txtClearCharge.Text = sys.TextToNum(rs("ClearCharge"))
txtTotal.Text = sys.TextToNum(rs("Total"))
txtWeight.Text = sys.TextToNum(rs("Weight"))
Call MakeTotal
Else
MsgBox "数据错误!"
Unload Me
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If frmTraffic.ActiveControl = True Then
Call frmTraffic.query
End If
End Sub
'合计
Private Sub MakeTotal()
txtTotal.Text = sys.TextToNum(txtBasicCarriage.Text) + sys.TextToNum(txtLocalCarriage.Text) + sys.TextToNum(txtServeCharge.Text) - sys.TextToNum(txtFavourabile.Text) + sys.TextToNum(txtLoadCharge.Text) + sys.TextToNum(txtShortCarriage.Text) + sys.TextToNum(txtStorageCharge.Text) + sys.TextToNum(txtClearCharge.Text)
If sys.TextToNum(txtWeight.Text) <> 0 Then
txtAvg.Text = FormatNumber(sys.TextToNum(txtTotal.Text / txtWeight.Text), 2)
Else
txtAvg.Text = 0
End If
End Sub
'检查表单数据
Private Function CheckForm() As Boolean
CheckForm = False
If txtCarNum.Text = "" Then
MsgBox "车号不能为空!"
txtCarNum.SetFocus
ElseIf cmbProductName.Text = "" Then
MsgBox "品名不能为空!"
cmbProductName.SetFocus
ElseIf cmbSendStation.Text = "" Then
MsgBox "发站不能为空!"
cmbSendStation.SetFocus
ElseIf cmbReceiveStation.Text = "" Then
MsgBox "到站不能为空!"
cmbReceiveStation.SetFocus
ElseIf txtWeight.Text = "" Then
MsgBox "重量不能为空!"
txtWeight.SetFocus
ElseIf txtBasicCarriage.Text = "" Then
MsgBox "国铁运费不能为空!"
txtBasicCarriage.SetFocus
ElseIf txtServeCharge.Text = "" Then
MsgBox "服务费不能为空!"
txtServeCharge.SetFocus
Else
CheckForm = True
End If
End Function
Private Sub txtBasicCarriage_Change()
Call MakeTotal
End Sub
Private Sub txtClearCharge_Change()
Call MakeTotal
End Sub
Private Sub txtFavourabile_Change()
Call MakeTotal
End Sub
Private Sub txtLoadCharge_Change()
Call MakeTotal
End Sub
Private Sub txtLocalCarriage_Change()
Call MakeTotal
End Sub
Private Sub txtServeCharge_Change()
Call MakeTotal
End Sub
Private Sub txtShortCarriage_Change()
Call MakeTotal
End Sub
Private Sub txtStorageCharge_Change()
Call MakeTotal
End Sub
Private Sub txtWeight_Change()
Call MakeTotal
End Sub
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页