以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  文本框内容转换为双进度小数  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=122734)

--  作者:yetle
--  发布时间:2018/8/1 9:36:00
--  文本框内容转换为双进度小数
已经做了转换,还是提示字符不能保存为双精度小数:
Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim str As String = txt.text
Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox8")
Dim str1 As String = txt1.text
Dim txt2 As WinForm.TextBox = e.Form.Controls("TextBox15")
Dim str2 As String = txt2.text
Dim txt3 As WinForm.TextBox = e.Form.Controls("TextBox22")
Dim str3 As String = txt3.text

Dim ytxt As WinForm.TextBox = e.Form.Controls("TextBox4")
Dim ystr As String = ytxt.text
Dim ytxt1 As WinForm.TextBox = e.Form.Controls("TextBox11")
Dim ystr1 As String = ytxt1.text
Dim ytxt2 As WinForm.TextBox = e.Form.Controls("TextBox18")
Dim ystr2 As String = ytxt2.text
Dim ytxt3 As WinForm.TextBox = e.Form.Controls("TextBox25")
Dim ystr3 As String = ytxt3.text


If usna  Like "*总经理*" Or usna="admin"  Then
For Each dr As Row In Tables("报价单").Rows
dr("订单量")=CDbl(str)
dr("订单量1")=CDbl(str1)
dr("订单量2")=CDbl(str2)
dr("订单量3")=CDbl(str3)

dr("利润点")=CDbl(ystr)
dr("利润点1")=CDbl(ystr1)
dr("利润点2")=CDbl(ystr2)
dr("利润点3")=CDbl(ystr3)
If dr IsNot Nothing Then
If dr("订单量") ="" Or dr("订单量1") ="" Or dr("订单量2") ="" Or dr("订单量3") ="" Then

MessageBox.show("不能记录""订单量""为空的报价","提示")
Return
End If
dr.save()
End If
Next

Else
    MessageBox.show("你无权执行此项操作!")
End If
[此贴子已经被作者于2018/8/1 9:57:21编辑过]

--  作者:有点甜
--  发布时间:2018/8/1 10:25:00
--  

CDbl 改成 Val

 

 


--  作者:yetle
--  发布时间:2018/8/1 11:41:00
--  
还是一样提示呢!
--  作者:有点甜
--  发布时间:2018/8/1 11:47:00
--  
以下是引用yetle在2018/8/1 11:41:00的发言:
还是一样提示呢!

 

上传具体实例测试。