以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  求助,输入车次后如何输入对应车次的车站名  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=21225)

--  作者:微笑烛光
--  发布时间:2012/7/5 21:44:00
--  求助,输入车次后如何输入对应车次的车站名
发帖心情 Post By:2012-7-5 21:34:00 [只看该作者]

我想设计一个火车票输入的视表,现有两张表,第一张

如附图1

第二张表,

如附图2

怎样在第一张表输入“车次”后,在第一张表的“终到站”一列里出现对应车次的所有车站的列表。


图片点击可在新窗口打开查看此主题相关图片如下:b1.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:b2.jpg
图片点击可在新窗口打开查看


--  作者:sunbrain
--  发布时间:2012/7/5 23:22:00
--  

表a_DataColChanged

 

If e.DataCol.Name = "车次" Then 

    Dim dr As DataRow

    dr = DataTables("车次表").Find("车次 = " & "\'" & e.DataRow("车次") & "\'" )

    If dr IsNot Nothing 

        

        e.DataRow("终到站")= dr("终到站")

    End If

End If


好好看看帮助吧


--  作者:sloyy
--  发布时间:2012/7/6 0:59:00
--  

表a_Click

Dim i As Integer
Dim Values As String
Dim dr As DataRow

dr = DataTables("车次").Find("车次 = " & "\'" & Tables("表A").Current("车次") & "\'" )

If dr IsNot Nothing
    Dim wz As Integer = Tables("车次").FindRow(dr)
    If wz >= 0 Then
        Tables("车次").Position = wz
    End If
   
    For i=1 To Tables("车次").Cols.Count-1
        If Tables("车次").Current(Tables("车次").Cols(i).Name) >"" Then
            Values = Values & Tables("车次").Current(Tables("车次").Cols(i).Name) &"|"
        End If
    Next
    Tables("表A").Cols("终到站").ComboList= Values
End If

[此贴子已经被作者于2012-7-6 1:12:02编辑过]

--  作者:微笑烛光
--  发布时间:2012/7/8 20:06:00
--  

谢谢指点!