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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Report and Data Environments is VB6 Enterprise

Status
Not open for further replies.

TheOneRing

Programmer
Feb 27, 2002
8
AU
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top