Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2001
    Posts
    45

    Unhappy Unanswered: How to let the user click an unbound checkbox

    I have a continous form with several checkboxes, each of them has a "formula", that returns True or False: ControlSource=myFunction('blabla')

    Now the user is not able to EDIT this checkbox anymore... it seems to be kind of 'locked'... Does anybody have an idea/approach to this problem? I need to keep the formula (can't put it in the oncurrent-event, since this is a continous form) AND let the user click on the checkboxes...

  2. #2
    Join Date
    Nov 2002
    Posts
    150

    Re: How to let the user click an unbound checkbox

    Originally posted by waldemar
    I have a continous form with several checkboxes, each of them has a "formula", that returns True or False: ControlSource=myFunction('blabla')

    Now the user is not able to EDIT this checkbox anymore... it seems to be kind of 'locked'... Does anybody have an idea/approach to this problem? I need to keep the formula (can't put it in the oncurrent-event, since this is a continous form) AND let the user click on the checkboxes...
    You sure it didn't get disabled or locked on the form or somewhere in the code?

  3. #3
    Join Date
    Nov 2001
    Posts
    45
    Yes; it looks like their value can not be changed if the controsource property contains a function call... but this is, what I need to do!....arghl!!

  4. #4
    Join Date
    Nov 2002
    Posts
    150
    Originally posted by waldemar
    Yes; it looks like their value can not be changed if the controsource property contains a function call... but this is, what I need to do!....arghl!!
    How about leaving them unbound and calling the function on the click event of the checkbox?

  5. #5
    Join Date
    Nov 2001
    Posts
    45
    Well this function is used to determine the value for the checkboxes, so I need to call it when each record is displayed. Since the oncurrent-event doesnt work in unbound checkboxes in a continous form (it can only access the very first record), i probably need to stick with the control source. (Dang, I feel this this is a dead-end-problem...)

  6. #6
    Join Date
    Dec 2002
    Posts
    50
    Can the formula be entered into the default for the checkbox? Or would it require code? It think that having a set formula to calculate the control of the checkbox would prevent the user from changing the value unless there is some way to trap an onclick event. Or maybee the formula could go in the before update event of the checkbox.

  7. #7
    Join Date
    Nov 2002
    Posts
    150
    Originally posted by waldemar
    Well this function is used to determine the value for the checkboxes, so I need to call it when each record is displayed. Since the oncurrent-event doesnt work in unbound checkboxes in a continous form (it can only access the very first record), i probably need to stick with the control source. (Dang, I feel this this is a dead-end-problem...)
    You should be able to get this to work on each checkbox's click event:

    Private Sub Check17_Click()
    Me.Check17.Value = MyFunction()
    End Sub

    or I am missing what you are trying to do????

  8. #8
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    could i ask a question

    what are you trying to do

    because the way i read the data, you've set the check box to the value in the fomular so every time it's changed it resets to the value of the function

    if the funtion is used to detemine the intial value if should be in the defaultvalue not control source
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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