Foxtable(狐表)用户栏目专家坐堂 → [求助]获取指定表的列宽设置,为何列宽都是-1


  共有4995人关注过本帖平板打印复制链接

主题:[求助]获取指定表的列宽设置,为何列宽都是-1

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


加好友 发短信
等级:一尾狐 帖子:436 积分:5082 威望:0 精华:0 注册:2012/3/27 15:33:00
[求助]获取指定表的列宽设置,为何列宽都是-1  发帖心情 Post By:2014/6/27 12:52:00 [只看该作者]

直接上代码

e.Form.Controls("TextBox1").Text = ""

Dim tmpString As String
Dim tmpName As String
Dim tmpWidth As Long

For Each c As Col In Tables(e.Form.Controls("txtTable").Text).Cols
    tmpName = c.Name
    tmpWidth = c.Width
    tmpString = tmpString & Chr(13) & Chr(10) & "Tables(" & e.Form.Controls("txtTable").Text & ").Cols(" & tmpName & ").Width =" & tmpWidth

Next

e.Form.Controls("TextBox1").Text = tmpString

 

以上代码目的,是指定表的列宽设置的代码生成模块

但是生成后,列宽都是-1,错在哪里,请指教

以下为生成代码

 

Tables(出货查询_Table1).Cols(业务类型).Width =-1
Tables(出货查询_Table1).Cols(下单人).Width =-1
Tables(出货查询_Table1).Cols(下单时间).Width =-1
Tables(出货查询_Table1).Cols(运单号).Width =-1
Tables(出货查询_Table1).Cols(入仓纸号).Width =-1
Tables(出货查询_Table1).Cols(进出类型).Width =-1
Tables(出货查询_Table1).Cols(收货车牌).Width =-1
Tables(出货查询_Table1).Cols(收货到达时间).Width =-1
Tables(出货查询_Table1).Cols(收货离开时间).Width =-1
Tables(出货查询_Table1).Cols(客户).Width =-1
Tables(出货查询_Table1).Cols(始发地).Width =-1
Tables(出货查询_Table1).Cols(目的地).Width =-1
Tables(出货查询_Table1).Cols(文件件数).Width =-1
Tables(出货查询_Table1).Cols(文件重量).Width =-1


 回到顶部