Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共14 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:窗口列表项目排除空值

1楼
wqc360 发表于:2010/1/16 9:28:00
请DX帮我看看,窗口组合框列表项目怎么不能排除空置,我代码哪里有问题,谢谢。
Dim cmb As WinForm.ComboBox = e.form.Controls("精度")
cmb.ComboList = DataTables("基础表").GetComboListString("精度","精度 = 'IsNot Nothing'")
Dim cmb3 As WinForm.ComboBox = e.form.Controls("装夹难度")
cmb3.ComboList = DataTables("基础表").GetComboListString("装夹","装夹 = 'IsNot Nothing'")
Dim cmb1 As WinForm.ComboBox = e.form.Controls("钢性")
cmb1.ComboList = DataTables("基础表").GetComboListString("钢性","钢性 = 'IsNot Nothing'")
2楼
czy 发表于:2010/1/16 11:16:00
Is Not Null
3楼
wqc360 发表于:2010/1/16 13:15:00
还是不行我两种都试了:
第一种:
Dim cmb As WinForm.ComboBox = e.form.Controls("精度")
cmb.ComboList = DataTables("基础表").GetComboListString("精度","精度 = 'Is Not Null '")
Dim cmb3 As WinForm.ComboBox = e.form.Controls("装夹难度")
cmb3.ComboList = DataTables("基础表").GetComboListString("装夹","装夹 = 'Is Not Null '")
Dim cmb1 As WinForm.ComboBox = e.form.Controls("钢性")
cmb1.ComboList = DataTables("基础表").GetComboListString("钢性","钢性 = 'Is Not Null '")
第二种:
Dim cmb As WinForm.ComboBox = e.form.Controls("精度")
cmb.ComboList = DataTables("基础表").GetComboListString("精度","精度 Is Not Null ")
Dim cmb3 As WinForm.ComboBox = e.form.Controls("装夹难度")
cmb3.ComboList = DataTables("基础表").GetComboListString("装夹","装夹 Is Not Null ")
Dim cmb1 As WinForm.ComboBox = e.form.Controls("钢性")
cmb1.ComboList = DataTables("基础表").GetComboListString("钢性","钢性 Is Not Null ")
4楼
czy 发表于:2010/1/16 13:46:00
你的问题有些让人摸不着头脑,GetComboListString本身就有排除空行功能的,怎么还会出现空值呢?
5楼
wqc360 发表于:2010/1/16 15:08:00
我这样也是过了,也是不行:
Dim cmb As WinForm.ComboBox = e.form.Controls("精度")
cmb.ComboList = DataTables("基础表").GetComboListString("精度")
Dim cmb3 As WinForm.ComboBox = e.form.Controls("装夹难度")
cmb3.ComboList = DataTables("基础表").GetComboListString("装夹 ")
Dim cmb1 As WinForm.ComboBox = e.form.Controls("钢性")
cmb1.ComboList = DataTables("基础表").GetComboListString("钢性")
6楼
czy 发表于:2010/1/16 15:16:00

你把结果图发上来看看。

7楼
yangming 发表于:2010/1/16 15:19:00
"精度 Is Not Null "
8楼
wqc360 发表于:2010/1/16 15:29:00
我是用5楼代码的结果,好像3个代码都会一样的结果,请看图片:

图片点击可在新窗口打开查看此主题相关图片如下:打开窗口时报错图片.bmp
图片点击可在新窗口打开查看


图片点击可在新窗口打开查看此主题相关图片如下:点确定能打开窗口,请看精度下拉项目.bmp
图片点击可在新窗口打开查看
9楼
czy 发表于:2010/1/16 15:46:00
如果设置正确,只能说你的来源列数据有问题。
选中精度列,排除重复内容看看结果怎么样?
10楼
wqc360 发表于:2010/1/16 15:55:00
精度列是字符型,结果一样的,在表中属性PrepareEdit事件中设置能正常使用,但我现在想做成窗口录入。
If e.IsFocusCell Then
    If e.Col.Name = "难度情况_精度" Then
        e.Col.Combolist = DataTables("基础表").GetComboListString("精度")
    End If
    If e.Col.Name = "难度情况_切削" Then
        e.Col.Combolist = DataTables("基础表").GetComboListString("切削")
    End If
    If e.Col.Name = "难度情况_装夹" Then
        e.Col.Combolist = DataTables("基础表").GetComboListString("装夹")
    End If
    If e.Col.Name = "难度情况_钢性" Then
        e.Col.Combolist = DataTables("基础表").GetComboListString("钢性")
    End If
    If e.Col.Name = "工序_班组" Then
        e.Col.Combolist = DataTables("基础表").GetComboListString("班组")
    End If
    If e.Col.Name = "工艺_工作中心组" Then
        e.Col.Combolist = DataTables("基础表").GetComboListString("工作中心组","[班组] = '" & e.Row("工序_班组") & "'")
    End If
End If
共14 条记录, 每页显示 10 条, 页签: [1] [2]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .04199 s, 2 queries.