Results 1 to 3 of 3

Thread: Can Somebody Please Check This??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2002
    Location
    INDIA
    Posts
    169

    Can Somebody Please Check This??

    Hi,

    Will Somebody please check this code ?? It is not working but I dont see any problem.
    Dim str As String

    Dim rst As New ADODB.Recordset

    str = "Select Sum(Total) as tot from Purchase where Chalan='" & txtchalan.Text & "'"
    rst.Open str, Connection.cn, adOpenKeyset, adLockOptimistic

    If rst.RecordCount > 0 Then

    txtamount = tot

    End if

    rst.close
    set rst=nothing

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    342
    txtamount = rst!tot
    ksm

  3. #3
    Addicted Member
    Join Date
    Feb 2002
    Location
    Belgium
    Posts
    190
    VB Code:
    1. Dim str As String
    2.  
    3. Dim rst As New ADODB.Recordset
    4.  
    5. str = "Select Sum(Total) as tot from Purchase where Chalan = '" & txtchalan.Text & "'"
    6. rst.Open str, Connection.cn, adOpenKeyset, adLockOptimistic
    7.  
    8. If rst.RecordCount > 0 Then
    9.    txtamount = tot
    10. End if
    11.  
    12. rst.close
    13. set rst=nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width