Struggling with another currentdb.execute clause......
Trying to INSERT INTO a table named [ShiftReportingMachinePull
Details] the field DenominationID fields FROM a query [qry_Denomination_Currency
The SQL of my query is
SELECT Denomination.DenominationID, Denomination.Denomination, Denomination.DenominationMultiple, Denomination.DenominationTypeID, Denomination.Active, DCount("DenominationID","qry_Denomination_Currency_Active","DenominationID <= " & [DenominationID]) AS CurrencyActiveDenominationSeq
WHERE (((Denomination.DenominationTypeID)=2) AND ((Denomination.Active)=-1));
The portion of the overall code I have for the INSERT INTO Private sub is
Dim i as Integer
i = 1
Do Until i = Forms![frm_DataReporting]![LVLReportingTypeSelect].[txtCntActiveCurrencyDenominations]
CurrentDb.Execute "INSERT INTO ShiftReportingMachinePullDetails (DenominationID) VALUES (" & DenominationID & ")" & " FROM [qry_Denomination_Currency_Active]" & " WHERE [CurrencyActiveDenominationSeq]= " & i, dbFailOnError
i = i + 1
I keep getting Compile error:
Variable not defined.