Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    186

    Unanswered: Hiding text box on report - Access 2007

    Hi! thanks for reading this request

    I am having trouble hiding 2 text boxes on a report, based on the value of a third textbox
    Record source is a query

    The value is in SPLITINV datatype is number
    If that record has a 4
    I want C40 and C60 to be visible

    Otherwise they should be hidden

    With this example, I have C40 and C60 set to No in the properties, visible
    But this doesn't work, C40 and C60 don't show at all

    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      
       Me.C40.Visible = (Me.SPLITINV = 4)
       Me.C60.Visible = (Me.SPLITINV = 4)
    
    End Sub
    With this example, I have C40 and C60 set to Yes in the properties, visible
    But this doesn't work, they are visible for every record
    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
        If Me.SPLITINV = 4 Then
       Me.C40.Visible = True
       Me.C60.Visible = True
       Else
       End If
    
    End Sub
    Can you offer any insight on what I am missing?
    THANKS!!

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I would expect the first to work. The second needs code in the Else setting visible to false. Are you sure of the data type? Does this work?

    Me.C40.Visible = (Me.SPLITINV = "4")
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •