Foxtable(狐表)用户栏目专家坐堂 → [求助]如何将选定行填充到其它表


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

主题:[求助]如何将选定行填充到其它表

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2009/11/18 9:04:00 [显示全部帖子]

Dim Filter As String
Dim Product As String
Dim Discount As Double
With e.Form.Controls("TextBox1")
    Product = .value
    If Product > "" Then
        Filter = "[姓名] Like " & "'*" & product & "*'" & " Or [身份证号码] Like " & "'*" & product & "*'" & " Or [户主] Like " & "'*" & product & "*'" 
    End If
    For Each dr1  as DataRow In DataTables("适龄青年数据库").Select(Filter)
          Dim dr2 As DataRow = DataTables("报名数据").AddNew
          For Each c As DataCol In DataTables("适龄青年数据库").DataCols
            dr2(c.Name) = dr1(c.Name)
          Next
    Next
End With

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2009/11/18 23:46:00 [显示全部帖子]

Dim Filter As String
Dim Product As String
Dim Discount As Double
With e.Form.Controls("TextBox1")
    Product = .value
    If Product > "" Then
        Filter = "[姓名] Like " & "'*" & product & "*'" & " Or [身份证号码] Like " & "'*" & product & "*'" & " Or [户主] Like " & "'*" & product & "*'" 
    End If
    Dim dr1 As DataRow =  DataTables("适龄青年数据库").Find(Filter)
    If dr1 IsNot Nothing Then
          Dim dr2 As DataRow = DataTables("报名数据").AddNew
          For Each c As DataCol In DataTables("适龄青年数据库").DataCols
            dr2(c.Name) = dr1(c.Name)
          Next
    End if
End With

 回到顶部