txtsql = "ProductID=(select ProductID from tblProduct where Name='" & ProductName & "' AND Size = '" & ProductSize & "')"
sql = "select Price from tblIn where InDate=(select max(InDate) from tblIn where " & txtsql ") & " and & txtsql
帮忙改下好吗?谢谢了
VB的

解决方案 »

  1.   

    sql = "select Price from tblIn where InDate=(select max(InDate) from tblIn 
    where " & txtsql & " )  and " & txtsql & ""
      

  2.   

    是不是要这样:
    txtsql = " ProductID=(select ProductID from tblProduct where Name='" & ProductName & "' AND Size = '" & ProductSize & "')"
    sql = "select Price from tblIn where InDate=(select max(InDate) from tblIn where " & txtsql & ") and " & txtsql
      

  3.   

    sql = "select Price from tblIn where InDate=(select max(InDate) from tblIn 
    where " & " " & txtsql