vb 中MsgBox多行记录

 Dim cInvo_No As String
         Dim cSql As String
         Dim cRec As rdoResultset
         Dim s As String
        cInvo_No = Trim(FlexGrid.TextMatrix(FlexGrid.Row, 1))
        cSql = " select A.cPact_No 合同号,A.cDate 交款日期,I.iAmount 交款金额 " _
          & " from dbo.tbl_Invo_Net I INNER JOIN tbl_Account_Net A ON I.cNo = A.cReg_No " _
          & "where I.cInvo_No = '" & cInvo_No & "' order by A.cDate"
        Set cRec = gDataChe.OpenResultset(cSql, rdOpenKeyset)
        If cRec.RowCount <> 0 Then
           While Not cRec.EOF
               s = s & "合同号:" & cRec(0) & " 交款日期:" & cRec(1) & " 金额:" & cRec(2) & "" & vbCrLf
           cRec.MoveNext
           Wend
               MsgBox s
           Else
               MsgBox "无交款记录"
        End If
posted @ 2008-06-20 11:30  艾伦  阅读(952)  评论(0编辑  收藏  举报