Rss & SiteMap

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

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

标题:列拆分

1楼
fangshen 发表于:2025/2/25 9:22:00
各位大侠:我希望实现如下功能

在”表“,有A列,B列,C列,D列,希望把   A列  的字符根据   |   拆分到B列,C列,D列
例子:A列  的内容   中国|上海|青浦
        希望拆分成   B列=中国,C列=上海,D列=青浦

谢谢
2楼
有点蓝 发表于:2025/2/25 9:43:00
http://www.foxtable.com/webhelp/topics/0625.htm

DataColChanged事件
If e.DataCol.Name = "A列" Then
    
If e.NewValue > "" Then 
      dim ss() as string = 
e.NewValue.split("|") 'http://www.foxtable.com/webhelp/topics/0245.htm
 e.DataRow("B列") = ss(0)
if ss.length > 1 then
 e.DataRow("C列") = ss(1)
end if
if ss.length > 2 then
 e.DataRow("D") = ss(2)
end if
    
End If
End
 
If

已有数据在输入表事件代码后,重置一下A列
[此贴子已经被作者于2025/2/25 9:43:42编辑过]
共2 条记录, 每页显示 10 条, 页签: [1]

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

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