以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]要使combobox控件显示为空该用什么代码? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=56628) |
-- 作者:lijin951 -- 发布时间:2014/9/10 9:18:00 -- [求助]要使combobox控件显示为空该用什么代码? 我的代码是 Dim a As WinForm.TextBox = e.Form.Controls("combobox1") a.text = "" 但是会出现错误:从字符串“123123”到类型“Double”的转换无效。
|
-- 作者:Bin -- 发布时间:2014/9/10 9:20:00 -- 这个代码没道理会出现这个错误.错误肯定在其他地方.其他代码. 上个例子看看吧
|
-- 作者:有点甜 -- 发布时间:2014/9/10 9:20:00 -- e.Form.Controls("combobox1").Text = "" |
-- 作者:lijin951 -- 发布时间:2014/9/10 9:23:00 -- 先有一个窗口的afterload属性 If DataTables("入库主表").DataRows.Count <> 0 Then \'\'主表有值的情况下 Dim a As String = Tables("入库主表").Current("购进单据号") Dim b As WinForm.DateTimePicker = e.Form.Controls("gjsr") Dim c As WinForm.ComboBox = e.Form.Controls("ghs") Dim d As WinForm.TextBox = e.Form.Controls("cgr") Dim f As WinForm.TextBox = e.Form.Controls("zy") Dim g As WinForm.TextBox = e.Form.Controls("zdr") Dim h As WinForm.TextBox = e.Form.Controls("shdh") Tables("入库单_t1").Filter = "购进单据号 = \'" & a & "\'" b.text = Tables("入库主表").Current("购进日期") c.text = Tables("入库主表").Current("供应商") d.text = Tables("入库主表").Current("采购人") f.text = Tables("入库主表").Current("摘要") g.text = Tables("入库主表").Current("制单人") h.text = Tables("入库主表").Current("随货单号") Else Dim b1 As WinForm.DateTimePicker = e.Form.Controls("gjsr") Dim g1 As WinForm.TextBox = e.Form.Controls("zdr") b1.Value = Date.Today() g1.Value = User.Name End If 然后问题出现在新增的时候,以下是新增按钮的代码 If DataTables("入库主表").DataRows.Count = 0 Then \'\'主表无记录的情况 Tables("入库主表").AddNew Dim a As String = Tables("入库主表").Current("购进单据号") Dim b As WinForm.DateTimePicker = e.Form.Controls("gjsr") Dim c As WinForm.TextBox = e.Form.Controls("zdr") b.Value = Date.Today() c.Value = User.Name Tables("入库主表").Current("购进日期") = b.Value Tables("入库单_t1").Filter = "购进单据号 = \'" & a & "\'" Else If Tables("入库主表").Current("供应商") <> 0 Then \'\'主表有记录且有值 Tables("入库主表").AddNew Dim a1 As String = Tables("入库主表").Current("购进单据号") Dim b1 As WinForm.DateTimePicker = e.Form.Controls("gjsr") Dim d As WinForm.ComboBox = e.Form.Controls("ghs") Dim f As WinForm.TextBox = e.Form.Controls("cgr") Dim g As WinForm.TextBox = e.Form.Controls("zy") Dim c1 As WinForm.TextBox = e.Form.Controls("zdr") Dim h As WinForm.TextBox = e.Form.Controls("shdh") b1.Value = Date.Today() c1.Value = User.Name d.text = "" f.text = "" g.text = "" h.text = "" Tables("入库主表").Current("购进日期") = b1.Value Tables("入库单_t1").Filter = "购进单据号 = \'" & a1 & "\'" Else \'有记录无值的情况 Dim a2 As String = Tables("入库主表").Current("购进单据号") MessageBox.Show( a2 & "已经是新的出库单无需继续新增","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) End If End If |
-- 作者:Bin -- 发布时间:2014/9/10 9:26:00 -- 你是操作哪里出现的错误,错误的提示截图出来看看.(记得要点击显示详细信息) |
-- 作者:lijin951 -- 发布时间:2014/9/10 9:30:00 -- 就是这个 此主题相关图片如下:qq图片20140910093135.jpg |
-- 作者:有点甜 -- 发布时间:2014/9/10 9:31:00 -- http://www.foxtable.com/help/topics/1485.htm
|
-- 作者:lijin951 -- 发布时间:2014/9/10 9:31:00 -- 对应4楼的第二段代码,那就是Button5的click时间 |
-- 作者:有点甜 -- 发布时间:2014/9/10 9:34:00 -- 自己排查一下错误
http://www.foxtable.com/help/topics/1485.htm
|
-- 作者:lijin951 -- 发布时间:2014/9/10 10:23:00 -- 还是搞不定找到有问题的代码了,但是不知道接下来该怎么办,有问题的代码如下(红色表示) If Tables("入库主表").Current("供应商") <> 0 Then \'\'主表有记录且有值 Tables("入库主表").AddNew Dim a1 As String = Tables("入库主表").Current("购进单据号") Dim b1 As WinForm.DateTimePicker = e.Form.Controls("gjsr") Dim d As WinForm.ComboBox = e.Form.Controls("ghs") Dim f As WinForm.TextBox = e.Form.Controls("cgr") Dim g As WinForm.TextBox = e.Form.Controls("zy") Dim c1 As WinForm.TextBox = e.Form.Controls("zdr") Dim h As WinForm.TextBox = e.Form.Controls("shdh") b1.Value = Date.Today() c1.Value = User.Name d.text = "" f.text = "" g.text = "" h.text = "" Tables("入库主表").Current("购进日期") = b1.Value Tables("入库单_t1").Filter = "购进单据号 = \'" & a1 & "\'" 随便问下,那个output命令窗口在哪打开啊? |