Results 1 to 5 of 5
  1. #1
    Join Date
    May 2012
    Posts
    132

    Unanswered: Check box in a form

    I have made an unbound check box, named “myckeck” in a form which shows data from a table in tabular layout.
    1- When I check one check box, all check boxes are checked. How can I solve that? I mean I want to check or clear check boxes independently.
    2- I made a text box, named “jobdate” to sow todays date automatically upon checking a check box. I made this code:
    Code:
    Private sub mycheck_afterupdate()
    jobdate = date
    End
    But this is not working and checking a check box does not make anything to happen.
    3- Then I made this expression in the default value of “jobdate” properties:
    iif( mycheck = true, date(), null)
    This not working either.

    Thank you
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  2. #2
    Join Date
    Nov 2012
    Posts
    79
    Did you ensure that all of your check boxes aren't linked to the same control source?
    Version: Access 2010

  3. #3
    Join Date
    May 2012
    Posts
    132
    it is unbound. so the control source is clear.
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  4. #4
    Join Date
    Nov 2012
    Posts
    79
    Hm. I'm not sure about the check boxes. But I created a form with your code. I noticed you used "End" as opposed to "End Sub" at the end of the procedure. Was this a typo or is this an exact copy of your code. If so that's probably the issue.

    Code:
    Private Sub Check0_AfterUpdate()
          Me.Text2 = Date
    End Sub
    Also, try adding Me. prior to your controls.
    Version: Access 2010

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by ariansman View Post
    I have made an unbound check box, named “myckeck” in a form which shows data from a table in tabular layout.
    1- When I check one check box, all check boxes are checked. How can I solve that? I mean I want to check or clear check boxes independently.
    You can't. If the Checkbox (or any other control for that matter) is unbound, there will be a single instance of that control on a form in Datasheet or Continuous view, although this instance will be repeated for each row. Use a bound control instead of an unbound one.
    Have a nice day!

Posting Permissions

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