Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2009
    Posts
    3

    Red face Unanswered: checkbox problem

    i am new to access i have 2 problems

    1) i have placed 1 checkbox in a form which is coded like this

    Private Sub Check24_Click()
    If Me![Check24].Value = True Then
    Me![Box6].Visible = True
    End If
    If Me![Check24].Value = False Then
    Me![Box6].Visible = False
    End If
    End Sub

    the problem is when i tick it all other forms checkbox are also ticked.

    2) i want to display box6 on a report for example when a checkbox on a form is ticked box6 should be displayed in report

  2. #2
    Join Date
    May 2005
    Posts
    126
    Provided Answers: 1
    What do you mean by Box 6, is this another CheckBox?

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    1) Code economy:
    Code:
    Private Sub Check24_Click()
        Me![Box6].Visible = Me![Check24].Value
    End Sub
    2) Me is a reference to the current object (form or report). If the code is in the class module of a form, Me!Box6 is obviously a control of the same form. If you want to reference a control on another form or report, the syntax is Forms!<OtherForm>!<Control> or Reports!<OtherReport>!<Control>.
    Have a nice day!

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    If ticking Check24 on one record causes it to be ticked on all records, you are using either a Continuous View or Datasheet View form and Check24 is an unbound control. This is normal behavior with these types of forms and unbound controls.

    Also, formatting on these types of forms has to be done using Conditional Formatting and can only control the Enabled Property, not it's visibility.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Sep 2009
    Posts
    3

    Smile Thanks

    hi Sinndho your coding really worked thank you very much.

    please solve my first problem also

    thanks once again.

    Nawaz

  6. #6
    Join Date
    Sep 2009
    Posts
    3

    Smile

    hi Missinglinq thank you for your support.

    please let me know how to create a bound check box

    as you said i might be using datasheet view or Continuous View

    i checked every thing i am using form view and in property Sheet it is enabled also.

    please help

    Thankyou
    Nawaz

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    A bound checkbox is like any other bound control. You have to have a field for it in your underlying table. Then, in the form's Design View, select the checkbox and goto Properties - Data and in the dropdown for Control Source select this same field.

    Now, whenever you tick the checkbox, it will only be ticked in that record, not in every record.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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