aggeliki23
Programmer
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.
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.