TheOneRing
Programmer
I am having a problem with writing a datareport. I have the following SQL Statement in a dataenvironment
SELECT tblServiceEquipment.strSerialNumber, tblCustomers.CompanyName, tblServiceTask.strServiceTaskNumber, tblServiceTask.dtmServiceTaskCreatedDate, tblServiceTask.dtmServiceTaskEndDate, tblServiceRequest.memDescription, tblServiceTask.dblBilledLabour, tblServiceTask.dblBilledTravel, tblServiceTask.dblBilledParts, tblServiceTask.dblPartsCost, tblServiceTask.memWorkPerformed FROM ((tblCustomers INNER JOIN tblServiceEquipment ON tblCustomers.CustomerID = tblServiceEquipment.strCustomerID) INNER JOIN tblServiceRequest ON (tblCustomers.CustomerID = tblServiceRequest.strBillTo) AND (tblCustomers.CustomerID = tblServiceRequest.strShipTo)) INNER JOIN tblServiceTask ON (tblServiceEquipment.lngSEID = tblServiceTask.lngSEID) AND (tblServiceRequest.lngServiceRequestID = tblServiceTask.lngServiceRequestID) WHERE (((tblServiceEquipment.strSerialNumber)='ASD7Z00298'));
Now this works fine and gives me back the information I want. In the dataenvironment I group on the company name so I can put the company name as a heading for the report. Now if I have this SQL hard coded in it works find and the report prints the company name and then lists the jobs. If I change the source for the dataenvironment at run time and then requery it etc and then go to show the report it comes up that it cannot find the fields in the detail section of the report. The SQL is exactly the same and the only thing that changes is the Serial Number. If anyone can help I would much appreciate it as I have tried for a couple of days now to get it right.
Also, can I change the label caption in a datareport at run time? If so how do I do it.
thanks
SELECT tblServiceEquipment.strSerialNumber, tblCustomers.CompanyName, tblServiceTask.strServiceTaskNumber, tblServiceTask.dtmServiceTaskCreatedDate, tblServiceTask.dtmServiceTaskEndDate, tblServiceRequest.memDescription, tblServiceTask.dblBilledLabour, tblServiceTask.dblBilledTravel, tblServiceTask.dblBilledParts, tblServiceTask.dblPartsCost, tblServiceTask.memWorkPerformed FROM ((tblCustomers INNER JOIN tblServiceEquipment ON tblCustomers.CustomerID = tblServiceEquipment.strCustomerID) INNER JOIN tblServiceRequest ON (tblCustomers.CustomerID = tblServiceRequest.strBillTo) AND (tblCustomers.CustomerID = tblServiceRequest.strShipTo)) INNER JOIN tblServiceTask ON (tblServiceEquipment.lngSEID = tblServiceTask.lngSEID) AND (tblServiceRequest.lngServiceRequestID = tblServiceTask.lngServiceRequestID) WHERE (((tblServiceEquipment.strSerialNumber)='ASD7Z00298'));
Now this works fine and gives me back the information I want. In the dataenvironment I group on the company name so I can put the company name as a heading for the report. Now if I have this SQL hard coded in it works find and the report prints the company name and then lists the jobs. If I change the source for the dataenvironment at run time and then requery it etc and then go to show the report it comes up that it cannot find the fields in the detail section of the report. The SQL is exactly the same and the only thing that changes is the Serial Number. If anyone can help I would much appreciate it as I have tried for a couple of days now to get it right.
Also, can I change the label caption in a datareport at run time? If so how do I do it.
thanks