Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

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

Options
  • 10-03-2004 1:31pm
    #1
    Registered Users 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 Posts: 61 ✭✭Orlie


    Brilliant! Thanks so much!


Advertisement