Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention. Check out this how-to article for more information.
Dim mydb As Database, rsEnq As Recordset Dim sqlCurrentBill As String sqlCurrentBill = "SELECT tblTransactions.BarNo, Sum(tblTransactions.Amount) AS SumOfAmount, tblTransactions.Invoiced " & vbCrLf & _ "FROM tblTransactions " & vbCrLf & _ "GROUP BY tblTransactions.BarNo, tblTransactions.Invoiced " & vbCrLf & _ "HAVING (((tblTransactions.BarNo)= '" & lngBarNo & "') AND ((tblTransactions.Invoiced)=""No""));" ' Create database. Set mydb = DBEngine.Workspaces(0).Databases(0) ' Create dynaset. Set rsEnq = mydb.OpenRecordset(sqlCurrentBill, DB_OPEN_SNAPSHOT) ' Populate text box controls. On Error Resume Next Me![txtCurrentBill].Value = rsEnq.Fields("[SumOfAmount]").Value mydb.Close
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.