MS Access查询不生成任何值

时间:2013-09-26 06:22:09

标签: vba ms-access ms-office access-vba ms-access-2010

这段代码早先工作得很好,但今天却没有给我任何价值。尽管可能的结果值已在相关表格中提供。这是有问题的查询。

  Private Sub BR_ID_LostFocus()   
  Dim s As String
  s = "Select Seat_No.Seat_No FROM Seat_No Where Seat_No.Seat_No <= (select    br_info.Seats_Reserved from br_info where Br_info.br_id=forms!pasenger_detail!br_id) AND (Seat_No.Seat_No) NOT IN (SELECT pasenger_detail.seat_no FROM pasenger_detail);"
  Me.Seat_No.RowSource = s
  Me.Seat_No.Requery
  End Sub

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

  1. 子查询中没有过滤NOT IN(SELECT pasenger_detail.seat_no FROM pasenger_detail);好吗?
  2. 表格pasenger_detail是否已打开?
  3. 'debug.print形成了什么!pasenger_detail!br_id'打印到即时窗口?