Welcome to SPN

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

Sign Up Now!

EASY CK BOX question I THINK!

Discussion in 'Information Technology' started by lmv, Jul 28, 2006.

  1. lmv

    lmv
    Expand Collapse
    Guest

    I have a unbound ck box that turns off my supplier code field if the code is
    NOT the correct code that time for the item. The person would then enter the
    code in the description field. I need the surpressed code to NOT print on the
    report. This is in a subform and the problems are:

    1) it is not just turning off supplier code in only 1 record it is turning
    of all records in the subform. (I need each record to have the choice do I
    need to make it bound instead since it is a continuous form)

    2) How do I code the criteria in the VBA to SHOW "nothing" on the report if
    the box is checked? (at this time when I clk my report button I still see the
    supplier code field)

    Code:
    Private Sub ckCodeOFF_AfterUpdate()
    If Me.ckCodeOFF = True Then
    Me.SupplierCode.Enabled = False
    Me.SupplierCode.Visible = False
    Else
    Me.SupplierCode.Enabled = True
    Me.SupplierCode.Visible = True
    End If

    End Sub
    ---
    Above code also in child not in parent.

    Private Sub Form_Current()

    THANKS!
     
  2. Loading...

    Similar Threads Forum Date
    Why its easy to be a Sikh and the Master of Puppets Blogs Oct 17, 2015
    easy, develop another addiction! Blogs Oct 16, 2015
    How To Conquer the World: Easy (by the Poet Warrior) Sikh Youth Feb 23, 2013
    USA Not easy to divide Wisconsin Sikh Gurdwara Shooting Donations... Breaking News Sep 6, 2012
    Opinion Human Evolution: No Easy Fix Breaking News Oct 5, 2011

  3. schasteen

    schasteen
    Expand Collapse
    Guest

    You will need to make this a bound check box, so that the database can
    associate the check box with the correct record. The code you have will then
    hide it on the sub form, but you will also have to put the same code in the
    on current event of the subform for it to work properly. For your report,
    you will need to add something like

    Me![SupplierCode].Visible = not Me![ckCodeOFF]

    in the on format event of the detail section of the report

    "lmv" wrote:

    > I have a unbound ck box that turns off my supplier code field if the code is
    > NOT the correct code that time for the item. The person would then enter the
    > code in the description field. I need the surpressed code to NOT print on the
    > report. This is in a subform and the problems are:
    >
    > 1) it is not just turning off supplier code in only 1 record it is turning
    > of all records in the subform. (I need each record to have the choice do I
    > need to make it bound instead since it is a continuous form)
    >
    > 2) How do I code the criteria in the VBA to SHOW "nothing" on the report if
    > the box is checked? (at this time when I clk my report button I still see the
    > supplier code field)
    >
    > Code:
    > Private Sub ckCodeOFF_AfterUpdate()
    > If Me.ckCodeOFF = True Then
    > Me.SupplierCode.Enabled = False
    > Me.SupplierCode.Visible = False
    > Else
    > Me.SupplierCode.Enabled = True
    > Me.SupplierCode.Visible = True
    > End If
    >
    > End Sub
    > ---
    > Above code also in child not in parent.
    >
    > Private Sub Form_Current()
    >
    > THANKS!
    >
    >
    >
     
  4. lmv

    lmv
    Expand Collapse
    Guest

    Thanks... but it still isn't working right. I already had it in the current
    of the sub and I made it bound but it still shuts them all off. And I tried
    adding the code to the detail of the report but it didn't turn that off
    either. Maybe I am not doing something right. ??

    "schasteen" wrote:

    > You will need to make this a bound check box, so that the database can
    > associate the check box with the correct record. The code you have will then
    > hide it on the sub form, but you will also have to put the same code in the
    > on current event of the subform for it to work properly. For your report,
    > you will need to add something like
    >
    > Me![SupplierCode].Visible = not Me![ckCodeOFF]
    >
    > in the on format event of the detail section of the report
    >
    > "lmv" wrote:
    >
    > > I have a unbound ck box that turns off my supplier code field if the code is
    > > NOT the correct code that time for the item. The person would then enter the
    > > code in the description field. I need the surpressed code to NOT print on the
    > > report. This is in a subform and the problems are:
    > >
    > > 1) it is not just turning off supplier code in only 1 record it is turning
    > > of all records in the subform. (I need each record to have the choice do I
    > > need to make it bound instead since it is a continuous form)
    > >
    > > 2) How do I code the criteria in the VBA to SHOW "nothing" on the report if
    > > the box is checked? (at this time when I clk my report button I still see the
    > > supplier code field)
    > >
    > > Code:
    > > Private Sub ckCodeOFF_AfterUpdate()
    > > If Me.ckCodeOFF = True Then
    > > Me.SupplierCode.Enabled = False
    > > Me.SupplierCode.Visible = False
    > > Else
    > > Me.SupplierCode.Enabled = True
    > > Me.SupplierCode.Visible = True
    > > End If
    > >
    > > End Sub
    > > ---
    > > Above code also in child not in parent.
    > >
    > > Private Sub Form_Current()
    > >
    > > THANKS!
    > >
    > >
    > >
     
  5. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    It must be bound in some way to avoid the repetition
    might be simpler to use a multi-select listbox to achieve the task at hand
    though

    Pieter

    "lmv" <lmv@discussions.microsoft.com> wrote in message
    news:644C8004-FE88-4210-A114-8C867A72196B@microsoft.com...
    >I have a unbound ck box that turns off my supplier code field if the code
    >is
    > NOT the correct code that time for the item. The person would then enter
    > the
    > code in the description field. I need the surpressed code to NOT print on
    > the
    > report. This is in a subform and the problems are:
    >
    > 1) it is not just turning off supplier code in only 1 record it is turning
    > of all records in the subform. (I need each record to have the choice do I
    > need to make it bound instead since it is a continuous form)
    >
    > 2) How do I code the criteria in the VBA to SHOW "nothing" on the report
    > if
    > the box is checked? (at this time when I clk my report button I still see
    > the
    > supplier code field)
    >
    > Code:
    > Private Sub ckCodeOFF_AfterUpdate()
    > If Me.ckCodeOFF = True Then
    > Me.SupplierCode.Enabled = False
    > Me.SupplierCode.Visible = False
    > Else
    > Me.SupplierCode.Enabled = True
    > Me.SupplierCode.Visible = True
    > End If
    >
    > End Sub
    > ---
    > Above code also in child not in parent.
    >
    > Private Sub Form_Current()
    >
    > THANKS!
    >
    >
    >
     
  6. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    It must be bound in some way to avoid the repetition
    might be simpler to use a multi-select listbox to achieve the task at hand
    though

    Pieter

    "lmv" <lmv@discussions.microsoft.com> wrote in message
    news:644C8004-FE88-4210-A114-8C867A72196B@microsoft.com...
    >I have a unbound ck box that turns off my supplier code field if the code
    >is
    > NOT the correct code that time for the item. The person would then enter
    > the
    > code in the description field. I need the surpressed code to NOT print on
    > the
    > report. This is in a subform and the problems are:
    >
    > 1) it is not just turning off supplier code in only 1 record it is turning
    > of all records in the subform. (I need each record to have the choice do I
    > need to make it bound instead since it is a continuous form)
    >
    > 2) How do I code the criteria in the VBA to SHOW "nothing" on the report
    > if
    > the box is checked? (at this time when I clk my report button I still see
    > the
    > supplier code field)
    >
    > Code:
    > Private Sub ckCodeOFF_AfterUpdate()
    > If Me.ckCodeOFF = True Then
    > Me.SupplierCode.Enabled = False
    > Me.SupplierCode.Visible = False
    > Else
    > Me.SupplierCode.Enabled = True
    > Me.SupplierCode.Visible = True
    > End If
    >
    > End Sub
    > ---
    > Above code also in child not in parent.
    >
    > Private Sub Form_Current()
    >
    > THANKS!
    >
    >
    >




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4231 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     
  7. schasteen

    schasteen
    Expand Collapse
    Guest

    Not sure what may be wrong. Please give details of what it is or isn't
    doing. It is hard to guess since we can't see your database.

    "lmv" wrote:

    > Thanks... but it still isn't working right. I already had it in the current
    > of the sub and I made it bound but it still shuts them all off. And I tried
    > adding the code to the detail of the report but it didn't turn that off
    > either. Maybe I am not doing something right. ??
    >
    > "schasteen" wrote:
    >
    > > You will need to make this a bound check box, so that the database can
    > > associate the check box with the correct record. The code you have will then
    > > hide it on the sub form, but you will also have to put the same code in the
    > > on current event of the subform for it to work properly. For your report,
    > > you will need to add something like
    > >
    > > Me![SupplierCode].Visible = not Me![ckCodeOFF]
    > >
    > > in the on format event of the detail section of the report
    > >
    > > "lmv" wrote:
    > >
    > > > I have a unbound ck box that turns off my supplier code field if the code is
    > > > NOT the correct code that time for the item. The person would then enter the
    > > > code in the description field. I need the surpressed code to NOT print on the
    > > > report. This is in a subform and the problems are:
    > > >
    > > > 1) it is not just turning off supplier code in only 1 record it is turning
    > > > of all records in the subform. (I need each record to have the choice do I
    > > > need to make it bound instead since it is a continuous form)
    > > >
    > > > 2) How do I code the criteria in the VBA to SHOW "nothing" on the report if
    > > > the box is checked? (at this time when I clk my report button I still see the
    > > > supplier code field)
    > > >
    > > > Code:
    > > > Private Sub ckCodeOFF_AfterUpdate()
    > > > If Me.ckCodeOFF = True Then
    > > > Me.SupplierCode.Enabled = False
    > > > Me.SupplierCode.Visible = False
    > > > Else
    > > > Me.SupplierCode.Enabled = True
    > > > Me.SupplierCode.Visible = True
    > > > End If
    > > >
    > > > End Sub
    > > > ---
    > > > Above code also in child not in parent.
    > > >
    > > > Private Sub Form_Current()
    > > >
    > > > THANKS!
    > > >
    > > >
    > > >
     

Share This Page