Sheet = "GL DOWNLOAD"
ReturnValue = SysCmd(acSysCmdSetStatus, "Getting " & Format(Facility, "000000") & " GL Data...")
datalistsql = "SELECT DISTINCTROW GLDownload_PA.Oracle_Acct, GLDownload_PA.Oracle_Dept, GLDownload_PA.Oracle_JobCode, GLDownload_PA.AcctDesc, GLDownload_PA.Description, tblPayrollDeptTranslation.JobCodeDescription, Sum(GLDownload_PA.Amount) AS SumOfAmount FROM GLDownload_PA LEFT JOIN tblPayrollDeptTranslation ON GLDownload_PA.Oracle_JobCode = tblPayrollDeptTranslation.intJobCodeNumber GROUP BY GLDownload_PA.Oracle_Acct, GLDownload_PA.Oracle_Dept, GLDownload_PA.Oracle_JobCode, GLDownload_PA.AcctDesc, GLDownload_PA.Description, tblPayrollDeptTranslation.JobCodeDescription;"
Set DataList = MyDB.OpenRecordset(datalistsql, dbOpenSnapshot)
DataList.MoveLast
DataList.MoveFirst
RecordsToSend = DataList.RecordCount
ReturnValue = SysCmd(acSysCmdInitMeter, "Sending" & Format(Facility, "000000") & " GL Data...", RecordsToSend)
For J = 1 To RecordsToSend
ReturnValue = SysCmd(acSysCmdUpdateMeter, J)
CostReport.Worksheets(Sheet).Cells(J, 2).Value = DataList!Oracle_Acct
CostReport.Worksheets(Sheet).Cells(J, 3).Value = DataList!Oracle_Dept
CostReport.Worksheets(Sheet).Cells(J, 4).Value = DataList!Oracle_JobCode
CostReport.Worksheets(Sheet).Cells(J, 5).Value = DataList!AcctDesc
CostReport.Worksheets(Sheet).Cells(J, 6).Value = DataList!Description
CostReport.Worksheets(Sheet).Cells(J, 7).Value = DataList!JobCodeDescription
CostReport.Worksheets(Sheet).Cells(J, 8).Value = DataList!SumOfAmount
DataList.MoveNext
Next J
************************************************** ****
The question is, when I finished above code but i wanna insert the heading before insert each rows.
What the next step should i code on? I stop. For example, it can display the rows value but I need the rows heading before rows value. What next? Any suggestion? Please, forward.
Again, thanks