Keith Williamson
Kwilliamson at RTKL.com
Thu Dec 21 08:06:21 CST 2006
Ooh...Thanks! I'll try that. Thanks for the review. Regards, Keith E. Williamson | Assist. Controller| kwilliamson at rtkl.com RTKL Associates Inc. | 901 South Bond Street | Baltimore, Maryland 21231-3305 410-537-6098 direct | 410-276-2136 fax | www.rtkl.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, December 21, 2006 3:20 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Unbound Subform Revisited Hi Keith This line caught my eye: "WHERE [qryWeeklyTimesheetVarianceSummary].[Entity] = "00" And Should read: "WHERE [qryWeeklyTimesheetVarianceSummary].[Entity] = '00' And /gustav >>> Kwilliamson at RTKL.com 20-12-2006 23:59 >>> Well....I tried that, as follows: Dim strSQL As String strSQL = "SELECT [qryWeeklyTimesheetVarianceSummary].[Year], [qryWeeklyTimesheetVarianceSummary].[Month], [qryWeeklyTimesheetVarianceSummary].[Entity], Sum([qryWeeklyTimesheetVarianceSummary].[SumOfRegPay]) AS [Reg Stand Cost], Sum([qryWeeklyTimesheetVarianceSummary].[SumOfOvtPay]) AS [OT Standard Cost], Sum([qryWeeklyTimesheetVarianceSummary].[SumOfOvt2Pay]) AS [OT2 Standard Cost], Sum([sumofregpay]+[sumofovtpay]+[sumofovt2pay]) AS [Total Standard Cost], Sum([qryWeeklyTimesheetVarianceSummary].[ActReg]) AS [Calc Reg Cost], Sum([qryWeeklyTimesheetVarianceSummary].[ActOvt]) AS [Calc OT Cost], Sum([qryWeeklyTimesheetVarianceSummary].[ActOvt2]) AS [Calc OT2 Cost], Sum([actreg]+[actovt]+[actovt2]) AS [Total Calc Cost], First([qryPayrollPaid].[SumOfAmountPaid]) AS FirstOfSumOfAmountPaid, First([qryPayrollDiffSummary].[SumOfHrs]) AS FirstOfSumOfHrs, First([qryPayrollDiffSummary].[SumOfWageDiff]) AS FirstOfSumOfWageDiff " + _ "FROM qryPayrollDiffSummary RIGHT JOIN (qryPayrollPaid RIGHT JOIN qryWeeklyTimesheetVarianceSummary ON ([qryPayrollPaid].[Year]=[qryWeeklyTimesheetVarianceSummary].[Year]) AND ([qryPayrollPaid].[Month]=[qryWeeklyTimesheetVarianceSummary].[Month]) AND ([qryPayrollPaid].[Entity]=[qryWeeklyTimesheetVarianceSummary].[Entity]) ) ON ([qryPayrollDiffSummary].[Entity]=[qryWeeklyTimesheetVarianceSummary].[E ntity]) AND ([qryPayrollDiffSummary].[Month]=[qryWeeklyTimesheetVarianceSummary].[Mo nth]) AND ([qryPayrollDiffSummary].[Year]=[qryWeeklyTimesheetVarianceSummary].[Yea r]) " + _ "WHERE [qryWeeklyTimesheetVarianceSummary].[Entity] = "00" And [qryWeeklyTimesheetVarianceSummary].[Month] = 10 And [qryWeeklyTimesheetVarianceSummary].[Year] = 2006 " + _ "GROUP BY [qryWeeklyTimesheetVarianceSummary].[Year], [qryWeeklyTimesheetVarianceSummary].[Month], [qryWeeklyTimesheetVarianceSummary].[Entity]; " Me.RecordSource = strSQL Made no difference. I still got the Syntax Error. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com