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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

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