Rss & SiteMap

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

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

标题:[求助]组合框

1楼
苏州老街 发表于:2025/2/15 2:52:00
老师,点击组合框字段后”视图管理_Table1”表全部行被隐藏了只剩行号显示。


Tables("视图管理_Table1").StopRedraw
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
cmd.CommandText = "Select * Fr  om {视图} WHERE 视图名 = '" & e.sender.value & "'"
dt = cmd.ExecuteReader
dr = dt.DataRows(0)
Tables("视图管理_Table1").SetColVisibleWidth(dr("视图属性")) '恢复列位置和宽度

For Each cl As Col In Tables("视图管理_Table1").Cols
    If cl.Width = 0 Then
        cl.Visible = False
    End If
Next
Tables("视图管理_Table1").ResumeRedraw
2楼
有点蓝 发表于:2025/2/15 8:49:00
调试看看
msgbox(dr("视图属性"))

另外for循环去掉,没有任何用处
3楼
苏州老街 发表于:2025/2/15 9:18:00
老师,我想点击文本框字段后进行筛选窗口表数据。
4楼
有点蓝 发表于:2025/2/15 9:41:00
点击到click事件处理
5楼
苏州老街 发表于:2025/2/15 18:04:00
老师,我把代码摆在click事件处理没有用

Tables("视图管理_Table1").StopRedraw
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
cmd.CommandText = "Select * Fr om {视图} WHERE 视图名 = '" & e.sender.value & "'"
dt = cmd.ExecuteReader
dr = dt.DataRows(0)
Tables("视图管理_Table1").SetColVisibleWidth(dr("视图属性")) '恢复列位置和宽度

For Each cl As Col In Tables("视图管理_Table1").Cols
    If cl.Width = 0 Then
       cl.Visible = False
  End If
Next
Tables("视图管理_Table1").ResumeRedraw
6楼
有点蓝 发表于:2025/2/16 20:10:00
上面代码没有一句是和筛选有关的,根据窗口控件值做筛选请认真看这个帮助:http://www.foxtable.com/webhelp/topics/1058.htm

文本框valuechanged事件
Dim Filter As String
With
 e.sender
    
If .Value IsNot Nothing Then
        Filter = 
"某某筛选列 = '" & .Value & "'"
    
End If
End
 With
Tables("视图管理_Table1").Filter = Filter
[此贴子已经被作者于2025/2/16 20:10:28编辑过]
7楼
苏州老街 发表于:2025/2/17 7:34:00
谢谢老师
共7 条记录, 每页显示 10 条, 页签: [1]

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

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