Hi
I am getting the following error when i click cmdFFR (See note1): Invalid SQL statement, expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT' or 'UPDATE'. I can't figure out why this is. Spelling all seems to be correct.
Public Dimensions are as follow:
(Note1)
qryCountYearsPe rReceipt (from Private Sub cmdFFR_Click) above is made via Query Builder the code is as follows:
qryGroupByYears PerReceipt (which is a query from which qryCountYearsPe rReceipt is made) is also made by the query builder and code is as follows :
I am getting the following error when i click cmdFFR (See note1): Invalid SQL statement, expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT' or 'UPDATE'. I can't figure out why this is. Spelling all seems to be correct.
Public Dimensions are as follow:
Code:
Option Compare Database Option Explicit Public cnn As ADODB.Connection Public rst As New ADODB.Recordset
Code:
Private Sub cmdFFR_Click()
Dim intFFR As Byte
Set cnn = CurrentProject.Connection
rst.Open "qryCountYearsPerReceipt", cnn, adOpenKeyset, adLockOptimistic
With rst
intAddFFRYears = !CountOfYear
End With
End Sub
Code:
SELECT qryGroupByYearsPerReceipt.ReceiptID, Count(qryGroupByYearsPerReceipt.Year) AS CountOfYear FROM qryGroupByYearsPerReceipt GROUP BY qryGroupByYearsPerReceipt.ReceiptID HAVING (((qryGroupByYearsPerReceipt.ReceiptID)=[Forms]![frmFFR]![cboRcptID]));
Code:
SELECT qryGroupByYearsPerReceipt.ReceiptID, Count(qryGroupByYearsPerReceipt.Year) AS CountOfYear FROM qryGroupByYearsPerReceipt GROUP BY qryGroupByYearsPerReceipt.ReceiptID HAVING (((qryGroupByYearsPerReceipt.ReceiptID)=[Forms]![frmFFR]![cboRcptID]));
Comment