Hello everyone,
I am trying to work a shape command into a datareport for a payroll program here at work. Everything was working ok, until I started making more groupings with it. Now I get a strange error that says,
runtime error '-2147217900(80040e14)'
Column('PayrollNum') does not exist in appropriate rowset.
Here is the Code:
[code]
SQL$ = "SHAPE(SHAPE {SELECT 'CheckNum','PayDate','CheckAmount','PayrollNum'," _
& "'Department','EmpName','EmpNumber','Address1','Address2','City','State','Zip'," _
& "'RegHrsCur','RegHrsYTD','PrHrsCur','PrHrsYTD','GrossCur','GrossYTD','FICACur','FICAYTD'," _
& "'MDCRCur','MDCRYTD','FITCur','FITYTD','CSCur','CSYTD','SLCur','SLYTD','BRCur','BRYTD'," _
& "'OtherCur','OtherYTD','NetCur','NetYTD' FROM TEMPCHECKS}" _
& "AS grp1 COMPUTE grp1 BY 'PayrollNum','EmpNumber') AS grp2 COMPUTE grp2 BY 'PayrollNum'"
'Checking for instance of open connection, if open it will close
If viewcCnn.State = adStateOpen Then
viewcCnn.Close
End If
viewcCnn.Open "Provider = MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=f:databasesPayroll.mdb"
If viewCheckRS.State = adStateOpen Then
viewCheckRS.Close
End If
With viewCheckRS
.ActiveConnection = viewcCnn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Source = SQL$
.Open
End With
[/code]
I don't understand where the error is, the tablename and field names are all correct. Was it an error on my part on the computing portion of the shape command?
The DarthMoob