With rptSalesEnquiryChecklist
Set .DataSource = ar
.DataMember = ""

With .Sections("Section7").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptTextBox Then

Select Case .Item(i).Name
Case "txtAddress"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Address").Name

Case "txtSupplier_Company_Name"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Supplier_Company_Name").Name

Case "txtSupplier_Name"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Supplier_Name").Name

Case "txtProduct"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Product").Name

Case "txtContact_No"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Contact_No").Name
End Select
End If
Next i
End With
End With

[img] http://i48.photobucket.com/albums/f245/zykhoo/11.jpg [/img]
why my data report will prompt out this msg box? the data report got subreport or not?

With rptSalesEnquiryChecklist
Set .DataSource = ar
.DataMember = ""

With .Sections("Section7").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptTextBox Then

Select Case .Item(i).Name
Case "txtAddress"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Address").Name

Case "txtSupplier_Company_Name"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Supplier_Company_Name").Name

Case "txtSupplier_Name"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Supplier_Name").Name

Case "txtProduct"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Product").Name

Case "txtContact_No"
.Item(i).DataMember = ""
.Item(i).DataField = ar.Fields("Contact_No").Name
End Select
End If
Next i
End With
End With

[img] http://i48.photobucket.com/albums/f245/zykhoo/11.jpg [/img]
why my data report will prompt out this msg box? the data report got subreport or not?

i think u set ur datasource wrongly
is ar the dataenvironment?
check the file name of your source in the properies of the data report

set datareport.datasource= ar

Hi,

Do u have "Section7" yn ur datareport..
If u dont have any Groups and detail section must be "Section1"

Regards
Veena

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.