Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
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
Join the community of 500,000 technology professionals and ask your questions.