Need Help With Shape Command - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Need Help With Shape Command

darthmoobeydarthmoobey Posts: 140Member
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:
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
End If

viewcCnn.Open "Provider = MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=f:databasesPayroll.mdb"

If viewCheckRS.State = adStateOpen Then
End If

With viewCheckRS
.ActiveConnection = viewcCnn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Source = SQL$
End With

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
Sign In or Register to comment.