Foxtable(狐表)用户栏目专家坐堂 → 删除记录问题


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

主题:删除记录问题

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


加好友 发短信
等级:幼狐 帖子:133 积分:1453 威望:0 精华:0 注册:2015/6/15 14:05:00
删除记录问题  发帖心情 Post By:2015/12/21 12:46:00 [只看该作者]

我写了一段代码,目的是在删除父表(课程表)时,如果对应的子表(学习记录)有记录就提示不能删除!总是报错“未找到列 [xh]。”
Dim xh As String
Dim tbl As Table = Tables("课程表")
If tbl.Current IsNot Nothing Then
   xh= tbl.Current("序号")
End If
messagebox.show(xh)
Dim dr As DataRow
dr = DataTables("学习记录").Find("序号=xh")
If dr IsNot Nothing Then '如果找到的话
  MessageBox.Show("此班级还有学生,不能删除!")

Else
 MessageBox.Show("此班级没有学生,可以删除!")

End If

 回到顶部