Solved

Hide a field on a report

Posted on 2007-03-22
3
951 Views
Last Modified: 2013-11-28
Hi

How can i hide a text box on a report if the value of another text box is specific?

I have tried this on a open statment:

If Me.BagOrKg = "Kg" Then
Me.Overweight.Visible = False
Else
Me.Overweight.Visible = True

I know this is wrong - i'm trying though :)

0
Comment
Question by:d10u4v
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
stevbe earned 500 total points
ID: 18770198
use the Format event of the section the controls are in ... you also need to make sure your control names aere different than the name of the field they are bound to.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.txtBagOrKg.Value = "Kg" Then
    Me.txtOverweight.Visible = False
Else
    Me.txtOverweight.Visible = True
End If
End Sub
0
 

Author Comment

by:d10u4v
ID: 18770216
Well, the the BagOrKg field is on the Report Header and the rest is on the Report Footer?
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18770321
then use the footer's format event
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question