Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Datafield not found when display datareport

Status
Not open for further replies.

aggeliki23

Programmer
Feb 12, 2007
38
GR
Hello, i am trying to display a data report assigned on user's criteria.
My problem is that when the search_invoiceRep appears, appears a message box too, says ERROR Datafield 'ORDO2' NOT FOUND. I had a look to forum but i didn't found something to help me. I haven't understood what causes this error. Also i am new in datareport. Any suggestions please? Here is my code, i hope helps you.

Private Sub PrintCmd_Click()
shapesql = _
" SHAPE {" & sql & "} AS SrchOrders " & _
"APPEND ({" & sqlOrdDet & "} AS SrchOrdDet " & _
"RELATE 'OrderID' TO 'OrderID') AS SrchOrdDet"
Set rsRep = New ADODB.Recordset
rsRep.ActiveConnection = conn
rsRep.CursorLocation = adUseClient
rsRep.Open shapesql, conn, adOpenStatic, adLockOptimistic, -1
rsRep.MoveFirst
Set search_InvoiceRep.DataSource = rsRep
search_InvoiceRep.DataMember = rsRep.DataMember
With search_InvoiceRep.Sections("Section6")
'i think tha the error is here
.Controls("OrdIDTxt").DataField = _
rsRep.Fields("OrderID").Value
.Controls("ShipNameTxt").DataField = _
rsRep.Fields("ShipName").Value
End With
search_InvoiceRep.Show
end sub


Thank you
in advanced.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top