Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Hide Fields on Reports based upon criteria

Discussion in 'Information Technology' started by bondtk, Oct 28, 2005.

  1. bondtk

    bondtk
    Expand Collapse
    Guest

    This should be a very simple thing to do, but I'm running into the all famous
    2427 error code. I want to hide a field if a checkbox is checked. So here
    is my present code.

    Sub
    If [Proposal?]=-1 then Me.adminstamp.visible=false
    End Sub

    I put the [Proposal?] checkbox field on the report just in case that was the
    issue but still get the same error 2427 "You entered an expression that has
    no value"

    This type of code was easy to put on a form, but the report doesn't like it.
    Help!
     
  2. Loading...

    Similar Threads Forum Date
    World War 1 To show their contempt for death, some Sikhs had refused to hide in the trenches History of Sikhism May 14, 2014
    Opinion Underneath The Turban: Why Sikhs Do Not Hide Breaking News Aug 23, 2012
    Opinion Underneath the Turban: Why Sikhs Do Not Hide? Breaking News Aug 13, 2012
    UK Hideously diverse Britain: What makes a Sikh join the far right? (Editorial) Breaking News Jun 17, 2010
    Politics Stephen Harper's Canada Chided For Cowardice (Sikh Chic) Breaking News Jun 6, 2010

  3. Ofer

    Ofer
    Expand Collapse
    Guest

    Did you put this code on the On format event of the section where both fields
    are located in?
    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "bondtk" wrote:

    > This should be a very simple thing to do, but I'm running into the all famous
    > 2427 error code. I want to hide a field if a checkbox is checked. So here
    > is my present code.
    >
    > Sub
    > If [Proposal?]=-1 then Me.adminstamp.visible=false
    > End Sub
    >
    > I put the [Proposal?] checkbox field on the report just in case that was the
    > issue but still get the same error 2427 "You entered an expression that has
    > no value"
    >
    > This type of code was easy to put on a form, but the report doesn't like it.
    > Help!
    >
     
  4. bondtk

    bondtk
    Expand Collapse
    Guest

    Well, we're getting a little closer. Now I don't get the error. BUT now the
    field is not visible regardless of the value of [Proposal?] Here's my exact
    code.

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If [Proposal?] = -1 Then Me.Admin_Stamp.Visible = False
    End Sub

    "Ofer" wrote:

    > Did you put this code on the On format event of the section where both fields
    > are located in?
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "bondtk" wrote:
    >
    > > This should be a very simple thing to do, but I'm running into the all famous
    > > 2427 error code. I want to hide a field if a checkbox is checked. So here
    > > is my present code.
    > >
    > > Sub
    > > If [Proposal?]=-1 then Me.adminstamp.visible=false
    > > End Sub
    > >
    > > I put the [Proposal?] checkbox field on the report just in case that was the
    > > issue but still get the same error 2427 "You entered an expression that has
    > > no value"
    > >
    > > This type of code was easy to put on a form, but the report doesn't like it.
    > > Help!
    > >
     
  5. Ofer

    Ofer
    Expand Collapse
    Guest

    It becuase you never set it back to true, try this
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If [Proposal?] = -1 Then
    Me.Admin_Stamp.Visible = False
    else
    Me.Admin_Stamp.Visible = True
    End if
    End Sub
    =====================================
    Or
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.Admin_Stamp.Visible = Not ([Proposal?] = -1)
    End Sub


    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "bondtk" wrote:

    > Well, we're getting a little closer. Now I don't get the error. BUT now the
    > field is not visible regardless of the value of [Proposal?] Here's my exact
    > code.
    >
    > Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    > If [Proposal?] = -1 Then Me.Admin_Stamp.Visible = False
    > End Sub
    >
    > "Ofer" wrote:
    >
    > > Did you put this code on the On format event of the section where both fields
    > > are located in?
    > > --
    > > If I answered your question, please mark it as an answer. That way, it will
    > > stay saved for a longer time, so other can benifit from it.
    > >
    > > Good luck
    > >
    > >
    > >
    > > "bondtk" wrote:
    > >
    > > > This should be a very simple thing to do, but I'm running into the all famous
    > > > 2427 error code. I want to hide a field if a checkbox is checked. So here
    > > > is my present code.
    > > >
    > > > Sub
    > > > If [Proposal?]=-1 then Me.adminstamp.visible=false
    > > > End Sub
    > > >
    > > > I put the [Proposal?] checkbox field on the report just in case that was the
    > > > issue but still get the same error 2427 "You entered an expression that has
    > > > no value"
    > > >
    > > > This type of code was easy to put on a form, but the report doesn't like it.
    > > > Help!
    > > >
     
  6. bondtk

    bondtk
    Expand Collapse
    Guest

    You're a genious!!! Thank you very much. It works. Just can't leave out
    both sides of the "else".

    "Ofer" wrote:

    > It becuase you never set it back to true, try this
    > Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    > If [Proposal?] = -1 Then
    > Me.Admin_Stamp.Visible = False
    > else
    > Me.Admin_Stamp.Visible = True
    > End if
    > End Sub
    > =====================================
    > Or
    > Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    > Me.Admin_Stamp.Visible = Not ([Proposal?] = -1)
    > End Sub
    >
    >
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "bondtk" wrote:
    >
    > > Well, we're getting a little closer. Now I don't get the error. BUT now the
    > > field is not visible regardless of the value of [Proposal?] Here's my exact
    > > code.
    > >
    > > Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    > > If [Proposal?] = -1 Then Me.Admin_Stamp.Visible = False
    > > End Sub
    > >
    > > "Ofer" wrote:
    > >
    > > > Did you put this code on the On format event of the section where both fields
    > > > are located in?
    > > > --
    > > > If I answered your question, please mark it as an answer. That way, it will
    > > > stay saved for a longer time, so other can benifit from it.
    > > >
    > > > Good luck
    > > >
    > > >
    > > >
    > > > "bondtk" wrote:
    > > >
    > > > > This should be a very simple thing to do, but I'm running into the all famous
    > > > > 2427 error code. I want to hide a field if a checkbox is checked. So here
    > > > > is my present code.
    > > > >
    > > > > Sub
    > > > > If [Proposal?]=-1 then Me.adminstamp.visible=false
    > > > > End Sub
    > > > >
    > > > > I put the [Proposal?] checkbox field on the report just in case that was the
    > > > > issue but still get the same error 2427 "You entered an expression that has
    > > > > no value"
    > > > >
    > > > > This type of code was easy to put on a form, but the report doesn't like it.
    > > > > Help!
    > > > >
     

Share This Page