I am using a report that creates a Price List. Under certain categories I dont want a second price to appear.
I am using the following code in report to try and make this happen. the code works for the first condition but will not operate on the "And" section of the line marked in red
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
If [TxtDesc] = "Fertilisers Controlled Release Nutricote" Then
LblDisc.Visible = True
LblDisc.Caption = "Nutricote Quantity Discounts Buy 5 - 9 bags list less 5% Buy 10 - 19 bags list less 7.5% Buy 20 bags plus list less 10%"
LblDisc.Width = 3990
LblDisc.Height = 1450
LblDisc.Left = 3957
[CodeLbl].Top = 1815
[SizeLbl].Top = 1815
[PriceLbl].Top = 1815
[GstLbl].Top = 1815
[OuterLbl].Top = 1815
GroupHeader0.Height = 1450
ElseIf [TxtDesc] = "Fertiliser - Commercial" Then
txtPRICE.Visible = False
LblDisc.Visible = True
LblDisc.Height = 1500
LblDisc.Width = 3990
LblDisc.Left = 3957
[CodeLbl].Top = 1815
[SizeLbl].Top = 1815
[PriceLbl].Top = 1650
[GstLbl].Top = 1600
[OuterLbl].Top = 1800
GroupHeader0.Height = 1450
LblDisc.Caption = "Osmocote Quantity Discounts Buy 5 - 9 bags list less 5% Buy 10 - 19 bags list less 7.5% Buy 20 bags plus, list less 10%"
ElseIf [TxtDesc] = "Stakes Hardwood, Spiral & Tree Guards" Then
GroupHeader0.Height = 1150
LblDisc.Visible = True
LblDisc.Height = 300
LblDisc.Width = 8000
LblDisc.Left = 1500
LblDisc.Top = 600
LblDisc.Caption = "Ask about our discounts for bulk purchases of hardwood stakes"
[CodeLbl].Top = 850
[SizeLbl].Top = 850
[PriceLbl].Top = 850
[GstLbl].Top = 850
[OuterLbl].Top = 850
'GroupHeader0.Height = 1450
'LblDisc.Height = 1450
'GroupHeader0.Height = 1450
ElseIf [TxtDesc] = "Fertiliser - Commercial Water Soluble" Then
LblDisc.Visible = True
LblDisc.Width = 3990
LblDisc.Height = 1450
LblDisc.Left = 3957
GroupHeader0.Height = 1450
LblDisc.Caption = "PETERS Quantity Discounts Buy 5 - 9 bags list less 5% Buy 10 - 19 bags list less 7.5% Buy 20 bags plus, list less 10%"
LblDisc.Visible = True
LblDisc.Height = 1450
[CodeLbl].Top = 1815
[SizeLbl].Top = 1815
[PriceLbl].Top = 1550
[GstLbl].Top = 1550
[OuterLbl].Top = 1815
GroupHeader0.Height = 1450
LblDisc.Height = 1450
GroupHeader0.Height = 1450
ElseIf [TxtDesc] = "Stakes Bamboo Flower Sticks" Or [TxtDesc] = "Stakes Bamboo" _
Or [TxtDesc] = "Stakes Bamboo Nursery Grade Stakes" Then
LblDisc.Visible = True
LblDisc.Width = 5420
LblDisc.Height = 300
LblDisc.BorderStyle = 0
GroupHeader0.Height = 800
LblDisc.Caption = "Discounts on Bamboo Bulk Purchases apply"
LblDisc.Visible = True
LblDisc.Left = 3000
LblDisc.Top = 600
LblDisc.Height = 300
[CodeLbl].Top = 600
[SizeLbl].Top = 600
[PriceLbl].Top = 600
[GstLbl].Top = 600
[OuterLbl].Top = 600
'GroupHeader0.Height = 5.75
ElseIf [TxtDesc] = "Stakes Bamboo Nursery Grade Stakes" And [DESC] Like"GRO-MAX*" Then
txtPRICE.Visible = False
Else: LblDisc.Visible = False
[CodeLbl].Top = 300
[SizeLbl].Top = 300
[PriceLbl].Top = 300
[GstLbl].Top = 300
[OuterLbl].Top = 300
LblDisc.Height = 0
GroupHeader0.Height = 5.2
txtPRICE.Visible = True
End If
End Sub
Thanks in anticipation
Errol Featherstone
I am using the following code in report to try and make this happen. the code works for the first condition but will not operate on the "And" section of the line marked in red
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
If [TxtDesc] = "Fertilisers Controlled Release Nutricote" Then
LblDisc.Visible = True
LblDisc.Caption = "Nutricote Quantity Discounts Buy 5 - 9 bags list less 5% Buy 10 - 19 bags list less 7.5% Buy 20 bags plus list less 10%"
LblDisc.Width = 3990
LblDisc.Height = 1450
LblDisc.Left = 3957
[CodeLbl].Top = 1815
[SizeLbl].Top = 1815
[PriceLbl].Top = 1815
[GstLbl].Top = 1815
[OuterLbl].Top = 1815
GroupHeader0.Height = 1450
ElseIf [TxtDesc] = "Fertiliser - Commercial" Then
txtPRICE.Visible = False
LblDisc.Visible = True
LblDisc.Height = 1500
LblDisc.Width = 3990
LblDisc.Left = 3957
[CodeLbl].Top = 1815
[SizeLbl].Top = 1815
[PriceLbl].Top = 1650
[GstLbl].Top = 1600
[OuterLbl].Top = 1800
GroupHeader0.Height = 1450
LblDisc.Caption = "Osmocote Quantity Discounts Buy 5 - 9 bags list less 5% Buy 10 - 19 bags list less 7.5% Buy 20 bags plus, list less 10%"
ElseIf [TxtDesc] = "Stakes Hardwood, Spiral & Tree Guards" Then
GroupHeader0.Height = 1150
LblDisc.Visible = True
LblDisc.Height = 300
LblDisc.Width = 8000
LblDisc.Left = 1500
LblDisc.Top = 600
LblDisc.Caption = "Ask about our discounts for bulk purchases of hardwood stakes"
[CodeLbl].Top = 850
[SizeLbl].Top = 850
[PriceLbl].Top = 850
[GstLbl].Top = 850
[OuterLbl].Top = 850
'GroupHeader0.Height = 1450
'LblDisc.Height = 1450
'GroupHeader0.Height = 1450
ElseIf [TxtDesc] = "Fertiliser - Commercial Water Soluble" Then
LblDisc.Visible = True
LblDisc.Width = 3990
LblDisc.Height = 1450
LblDisc.Left = 3957
GroupHeader0.Height = 1450
LblDisc.Caption = "PETERS Quantity Discounts Buy 5 - 9 bags list less 5% Buy 10 - 19 bags list less 7.5% Buy 20 bags plus, list less 10%"
LblDisc.Visible = True
LblDisc.Height = 1450
[CodeLbl].Top = 1815
[SizeLbl].Top = 1815
[PriceLbl].Top = 1550
[GstLbl].Top = 1550
[OuterLbl].Top = 1815
GroupHeader0.Height = 1450
LblDisc.Height = 1450
GroupHeader0.Height = 1450
ElseIf [TxtDesc] = "Stakes Bamboo Flower Sticks" Or [TxtDesc] = "Stakes Bamboo" _
Or [TxtDesc] = "Stakes Bamboo Nursery Grade Stakes" Then
LblDisc.Visible = True
LblDisc.Width = 5420
LblDisc.Height = 300
LblDisc.BorderStyle = 0
GroupHeader0.Height = 800
LblDisc.Caption = "Discounts on Bamboo Bulk Purchases apply"
LblDisc.Visible = True
LblDisc.Left = 3000
LblDisc.Top = 600
LblDisc.Height = 300
[CodeLbl].Top = 600
[SizeLbl].Top = 600
[PriceLbl].Top = 600
[GstLbl].Top = 600
[OuterLbl].Top = 600
'GroupHeader0.Height = 5.75
ElseIf [TxtDesc] = "Stakes Bamboo Nursery Grade Stakes" And [DESC] Like"GRO-MAX*" Then
txtPRICE.Visible = False
Else: LblDisc.Visible = False
[CodeLbl].Top = 300
[SizeLbl].Top = 300
[PriceLbl].Top = 300
[GstLbl].Top = 300
[OuterLbl].Top = 300
LblDisc.Height = 0
GroupHeader0.Height = 5.2
txtPRICE.Visible = True
End If
End Sub
Thanks in anticipation
Errol Featherstone