• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 313
  • Last Modified:

Making text box controls visible and not visible in an Access 2003 report

I'm trying to make some text box controls visible or not visible under certain circumstances in a report using Access 2003 SP3.  I have tried various combinations of the following code and also tried various event properties of both the report and detail section of the report.  The best result has been to make controls for "Mod" visible but not those for "Low".  The controls which are to be visible or not visible have their visible property set to "No".

If Me.txtTractIncSegmt.Value = "Low" Then
         Me.txtLowIncNbrAppd.Visible = True
         Me.txtHMDALowGoal.Visible = True
         Me.txtLowIncPenetration.Visible = True
      ElseIf Me.txtTractIncSegmt.Value = "Mod" Then
         Me.txtModIncNbrAppd.Visible = True
         Me.txtHMDAModGoal.Visible = True
         Me.txtModIncPenetration.Visible = True
    End If

Any advice on how to solve this would be appreciated.
0
Liberty4all
Asked:
Liberty4all
  • 2
1 Solution
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
I woudl use teh on format event of the section with teh controls.

Something like this:


Me.txtLowIncNbrAppd.Visible = (Me.txtTractIncSegmt = "Low")                    Me.txtHMDALowGoal.Visible = (Me.txtTractIncSegmt = "Low")
Me.txtLowIncPenetration.Visible = (Me.txtTractIncSegmt = "Low")

Me.txtModIncNbrAppd.Visible = (Me.txtTractIncSegmt = "Mod")
Me.txtHMDAModGoal.Visible = (Me.txtTractIncSegmt = "Mod")
Me.txtModIncPenetration.Visible = (Me.txtTractIncSegmt = "Mod")

Open in new window

0
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
Try again:

I would use the on format event of the section with the controls.

Something like this:

Me.txtLowIncNbrAppd.Visible = (Me.txtTractIncSegmt = "Low")
Me.txtHMDALowGoal.Visible = (Me.txtTractIncSegmt = "Low")
Me.txtLowIncPenetration.Visible = (Me.txtTractIncSegmt = "Low")

Me.txtModIncNbrAppd.Visible = (Me.txtTractIncSegmt = "Mod")
Me.txtHMDAModGoal.Visible = (Me.txtTractIncSegmt = "Mod")
Me.txtModIncPenetration.Visible = (Me.txtTractIncSegmt = "Mod")

Open in new window

0
 
Liberty4allAuthor Commented:
I appreciate the quick response and simplicity of the solution.
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.

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