Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Making a text rows in report dissapear

Hi,

I have a number of rows with text in the report (see example in attached image).  What I need is for them to display when the numerical / date value is not zero and equally not display at all when the numerical values are zero.  This combination of what to display and what not is obviously different to each of the customers saved in this debtors database.  I also need rows to display one after the other in a normal letter format when rows of text without the numerical values are ommitted (i.e. no gaps between the text).  How do I do it?

Thanks

LillyC
letter-report.JPG
0
LillyC
Asked:
LillyC
1 Solution
 
Helen FeddemaCommented:
Assuming that you have a single textbox control for each line of text, the easiest way to make it disappear if a numeric value is zero is to set the section and  control's CanShrink property to Yes and write code on the Detail_Format event like the following (substituting your control and field names):
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

   If Me![UnitPrice] = 0 Then
      Me![txtProductPrice].Visible = False
   Else
      Me![txtProductPrice].Visible = True
   End If
   
End Sub

Open in new window

0
 
LillyCAuthor Commented:
Many thanks, it worked perfectly.  Sorry for a late reply as I was away.

LillyC
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now