Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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

  • 10-03-2004 01: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