Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Displaying results of a recordset in a text box...

  • 10-03-2004 12:31PM
    #1
    Registered Users, Registered Users 2 Posts: 61 ✭✭


    ' SQL statement
    strSQL = "SELECT SUM(ItemPrice) FROM FinancialDetailsFile WHERE CustomerId = " & grdEnquiry.Text

    ' Pass SQL statement to recordset
    Set rstTotalBill = dbHilton.OpenRecordset(strSQL)

    Does anyone know how I can dispaly the results of this in txtTotalBill? I've tried a few things which didn't work...


Comments

  • Closed Accounts Posts: 333 ✭✭McGintyMcGoo


    Firstly, I'd amend your query to be the following. Basically, giving the field a name

    ' SQL statement
    strSQL = "SELECT SUM(ItemPrice) as intSum FROM FinancialDetailsFile WHERE CustomerId = " & grdEnquiry.Text

    Then

    ' Pass SQL statement to recordset
    Set rstTotalBill = dbHilton.OpenRecordset(strSQL)

    And to use the result ...
    controlname.value = rstTotalBill!intSum


  • Registered Users, Registered Users 2 Posts: 61 ✭✭Orlie


    Brilliant! Thanks so much!


Advertisement