borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Is It Possible?) New Topic New Poll Post Reply
AndreaVB Forum : Reporting tools : Datareport Question
Poster Message
daggerass
Level: Trainee

Registered: 15-11-2007
Posts: 2

icon Datareport Question

Here my problem i nid a code that when every the data field is equal = 0 it will change the font color to white.

here is the my sample code, thank you very much.

Private Sub cmdPrint_Click()
On Error Resume Next
Dim RPT$, RPT2$

'outlet and transaction no. checking
If txtOutlet.Text = "" Then
MsgBox "Pls input outlet name in the text box"
txtOutlet.SetFocus
Exit Sub
End If

If txtOutletAdd.Text = "" Then
MsgBox "Pls input outlet address in the text box"
txtOutletAdd.SetFocus
Exit Sub
End If


RPT = InputBox("Enter Delivery Receipt Transaction No.")


Set rs = New ADODB.Recordset
rs.Open "SELECT * From tblStockout where SO_No='" & RPT & "'", cn
RPT2 = rs!SO_NO

Set DataReport2.DataSource = rs.DataSource



For Each obj In DataReport2.Sections("Section1").Controls
    If TypeOf obj Is RptTextB

ox Then
        obj.DataMember = rs.DataMember
    End If
Next
DataReport2.Sections("Section2").Controls("Label1").Caption = RPT2
DataReport2.Sections("Section1").Controls("Text1").DataField = "Product_ID"
DataReport2.Sections("Section1").Controls("Text2").DataField = "Color_1"
DataReport2.Sections("Section1").Controls("Text7").DataField = "Color_2"
DataReport2.Sections("Section1").Controls("Text12").DataField = "Color_3"
DataReport2.Sections("Section1").Controls("Text3").DataField = "Size_1"
DataReport2.Sections("Section1").Controls("Text4").DataField = "Size_2"
DataReport2.Sections("Section1").Controls("Text5").DataField = "Size_3"
DataReport2.Sections("Section1").Controls("Text6").DataField = "Size_XL"
DataReport2.Sections("Section1").Controls("Text8").DataField = "SColor2_1"
DataReport2.Sections("Section1").Controls("Text9").DataField = "SColor2_2"
DataReport2.Sections("Section1").Controls("Text10").DataField = "SColor2_3"
DataReport2.Sections("Section1").Controls("Text11").DataField = "SColor2_XL"
DataReport2.Sections("Secton1").Controls("Text13").DataField = "SColor3_1"
DataReport2.Sections("Section1").Controls("Text14").DataField = "SColor3_2"
DataReport2.Sections("Section1").Controls("Text15").DataField = "SColor3_3"
DataReport2.Sections("Section1").Controls("Text16").DataField = "SColor3_XL"
DataReport2.Sections("Section1").Controls("Text17").DataField = "Qty123"
DataReport2.Sections("Section1").Controls("Text18").DataField = "QtyXL"
DataReport2.Sections("Section5").Controls("Function2").DataField = "Quantity"
DataReport2.Sections("Section1").Controls("Text19").DataField = "Unit_Price"
DataReport2.Sections("Section1").Controls("Text20").DataField = "Unit_Price2"
DataReport2.Sections("Section1").Controls("Text21").DataField = "AmtQty123"
DataReport2.Sections("Section1").Controls("Text22").DataField = "AmtQtyXL"
DataReport2.Sections("Section5").Controls("Function1").DataField = "Amount"
DataReport2.Sections("Section2").Controls("Label2").Caption = txtOutlet.Text
DataReport2.Sections("Section2").Controls("Label9").Caption = txtOutletAdd.Text
DataReport2.Sections("Section2").Controls("Label13").Caption = DPDate_Released.Value
DataReport2.Refresh
DataReport2.Show
Set rs = Nothing
End Sub

16-11-2007 at 02:00 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 944
icon How do I hide a field on datareport if value=0

Moved & relabeld

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

05-01-2008 at 01:56 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Reporting tools : Datareport Question
Next Topic (Is It Possible?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder