Datareports in VB6 using Parent-Child Commands

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 5
Reputation: sumeetpingale is an unknown quantity at this point 
Solved Threads: 0
sumeetpingale sumeetpingale is offline Offline
Newbie Poster

Datareports in VB6 using Parent-Child Commands

 
0
  #1
Jan 11th, 2009
Hello Sir,
I am doing a project realted to Jewellery Valuation. I want a report generating specifically on a customer. For that i have created a query in ACCESS to group requried tables for generating report. Now if i drop down the customer name in Page Header Section (Which is Section2). At that position i want Customer Name to be displayed which is from database. If i insert Customer Name and their products the lable for the products get repeated as well as the customer name. And If i insert a Group Header by creating a parent-child relationship in dataenvironment, it gives me error (General Error). Please suggest me any other alternative so that i can display Customer Name at top of the report. Please see the attachment if not understand.
Attached Thumbnails
Data_report.JPG  
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Datareports in VB6 using Parent-Child Commands

 
0
  #2
Jan 12th, 2009
Hi,

Use SHAPE Command
  1. sSQL = "SHAPE {SELECT CustName FROM CustMaster} AS C " & _
  2. " APPEND ({SELECT * FROM Sales } AS S " _
  3. & " RELATE " & _
  4. " CustID To ID ) AS Cust_Sales "

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 5
Reputation: sumeetpingale is an unknown quantity at this point 
Solved Threads: 0
sumeetpingale sumeetpingale is offline Offline
Newbie Poster

Re: Datareports in VB6 using Parent-Child Commands

 
0
  #3
Jan 12th, 2009
Thanks for reply..
But i dn't understand to where we shoud write this code..
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Datareports in VB6 using Parent-Child Commands

 
0
  #4
Jan 13th, 2009
Hi,

That query is For the Command Object on which you design the Datareport..

Change Table/Field Names according to your database..

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 5
Reputation: sumeetpingale is an unknown quantity at this point 
Solved Threads: 0
sumeetpingale sumeetpingale is offline Offline
Newbie Poster

Re: Datareports in VB6 using Parent-Child Commands

 
0
  #5
Jan 13th, 2009
Thnks a lot for ur hlp..
Now i want to generate reports between two specific dates..
for tht i am using two DTPicker's.. here's d coding on the button to generate reports.

Private Sub cmdgenerate_Click()
Dim X As Variant
Dim Y As Variant
X = DTPickerstartdate.Value
Y = DTPickerenddate.Value

startdate = DateValue(DTPickerstartdate.Value)
enddate = DateValue(DTPickerenddate.Value)
   DTPickerstartdate.Value = str(startdate)
   DTPickerenddate.Value = str(enddate)
    var = (enddate - startdate)
    If var < 1 Then
        MsgBox "Choose proper dates", vbExclamation
    Else
    
DataEnvironment1.rptrenewal X, Y
rpt_renewal.Show
Unload DataEnvironment1
End If
Exit Sub
End Sub

But there is error at "DataEnvironment1.rptrenewal X, Y"
- Wrong number of arguments or invalid property assignment
Last edited by sumeetpingale; Jan 13th, 2009 at 9:49 am. Reason: Modify
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC