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.

Hi,

Use SHAPE Command

sSQL = "SHAPE {SELECT CustName FROM CustMaster}  AS C " & _
        " APPEND ({SELECT * FROM Sales }  AS S " _
        & " RELATE " & _
        " CustID To ID ) AS Cust_Sales "

Regards
Veena

Thanks for reply..
But i dn't understand to where we shoud write this code..

Hi,

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

Change Table/Field Names according to your database..

Regards
Veena

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

hi
i am using access database.I want to create dataenvironment with command1 and its child command1. then how can i write sql statemnet in chld command1.....?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.