Foxtable(狐表)用户栏目专家坐堂 → [原创]隐显列的设置


  共有3852人关注过本帖树形打印复制链接

主题:[原创]隐显列的设置

帅哥哟,离线,有人找我吗?
Cloud
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:156 积分:1328 威望:0 精华:0 注册:2016/6/21 12:27:00
  发帖心情 Post By:2022/4/18 13:50:00 [只看该作者]

关闭窗口后重新打开窗口输入订单款号查询


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107440 积分:546479 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/4/18 13:59:00 [只看该作者]

代码?!!

 回到顶部
帅哥哟,离线,有人找我吗?
Cloud
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:156 积分:1328 威望:0 精华:0 注册:2016/6/21 12:27:00
  发帖心情 Post By:2022/4/18 14:07:00 [只看该作者]

Dim ddkh As WinForm.ComboBox = e.Form.Controls("订单款号")
DataTables("订单主表").LoadFilter = "订单款号 = '" & ddkh.text & "'"
DataTables("订单主表").Load()
DataTables("颜色尺码").LoadFilter = "订单款号 = '" & ddkh.text & "'"
DataTables("颜色尺码").Load()
If DataTables("颜色尺码").DataRows.count > 0 AndAlso DataTables("颜色尺码").DataRows(0).IsNull("订单款号") Then
    MessageBox.Show("错误,第一行没有数据!")
    Tables("订单主表.颜色尺码").Cols("尺码66").Visible = True
End  If


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107440 积分:546479 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/4/18 14:17:00 [只看该作者]

说明第一行的"订单款号"不是空值

DataTables("颜色尺码").LoadFilter = "订单款号 = '" & ddkh.text & "'"
DataTables("颜色尺码").Load()
msgbox(DataTables("颜色尺码").DataRows(0).IsNull("订单款号"))
If DataTables("颜色尺码").DataRows.count > 0 AndAlso DataTables("颜色尺码").DataRows(0).IsNull("订单款号") Then
    MessageBox.Show("错误,第一行没有数据!")
    Tables("订单主表.颜色尺码").Cols("尺码66").Visible = True
End  If

 回到顶部
帅哥哟,离线,有人找我吗?
Cloud
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:156 积分:1328 威望:0 精华:0 注册:2016/6/21 12:27:00
  发帖心情 Post By:2022/4/18 17:10:00 [只看该作者]

大师:

 

If Tables("颜色尺码").Current("尺码66") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码66").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码66").Visible = False
End  If
If Tables("颜色尺码").Current("尺码73") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码73").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码73").Visible = False
End  If
If Tables("颜色尺码").Current("尺码80") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码80").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码80").Visible = False
End  If
If Tables("颜色尺码").Current("尺码90") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码90").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码90").Visible = False
End  If
If Tables("颜色尺码").Current("尺码100") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码100").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码100").Visible = False
End  If
If Tables("颜色尺码").Current("尺码110") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码110").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码110").Visible = False
End  If
If Tables("颜色尺码").Current("尺码120") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码120").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码120").Visible = False
End  If
If Tables("颜色尺码").Current("尺码130") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码130").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码130").Visible = False
End  If
If Tables("颜色尺码").Current("尺码140") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码140").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码140").Visible = False
End  If
If Tables("颜色尺码").Current("尺码150") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码150").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码150").Visible = False
End  If
If Tables("颜色尺码").Current("尺码160") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码160").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码160").Visible = False
End  If
If Tables("颜色尺码").Current("尺码165") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码165").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码165").Visible = False
End  If
If Tables("颜色尺码").Current("尺码170") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码170").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码170").Visible = False
End  If
If Tables("颜色尺码").Current("尺码175") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码175").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码175").Visible = False
End  If
If Tables("颜色尺码").Current("尺码180") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码180").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码180").Visible = False
End  If
If Tables("颜色尺码").Current("尺码185") > 0 Then
    Tables("订单主表.颜色尺码").Cols("尺码185").Visible = True
Else
    Tables("订单主表.颜色尺码").Cols("尺码185").Visible = False
End  If

 

我在颜色尺码表的AfterLoad中写这样的代码可以做到想要的效果,但是这样有点复杂,并且在删除查询框中的名称时会报错“未将对象引用设置到对象的实例”


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107440 积分:546479 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/4/18 17:21:00 [只看该作者]

Dim r As Row = Tables("颜色尺码").Current
If r IsNot Nothing Then
    For Each c As Col In Tables("订单主表.颜色尺码").Cols
        If c.name.StartsWith("尺码") Then
            c.Visible = (r(c.name) > 0)
        End If 
    Next
End If

 回到顶部
帅哥哟,离线,有人找我吗?
Cloud
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:156 积分:1328 威望:0 精华:0 注册:2016/6/21 12:27:00
  发帖心情 Post By:2022/4/18 17:30:00 [只看该作者]

大师:这么简单啊,谢谢,真的谢谢


 回到顶部
总数 17 上一页 1 2