Check Box Will Not Update

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dryjeans
    New Member
    • Mar 2008
    • 24

    Check Box Will Not Update

    I must be missing something.....I have a check box whose data source is a field in a table. Problem is, the check box will not reflect the value of the field. Here is my code

    =Case![Appeal Closed]

    The only thing I can think of is the table containing the data is a LINKED table. Does that make a difference???
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Linked table won't make any difference...

    Your syntax for the field is curious. If it is part of the underlying table or query to which the form is bound you are not referring to it correctly - there should be no need to qualify it as Case![some name], whatever Case is.

    If, in fact, you are trying to look up a value from a table called Case that is not bound to the form concerned you will need to use DLookup to do so, like this:

    Code:
    =DLookup("[Appeal Closed]", "[Case]", "<suitable where clause to restrict the Dlookup to a single row>")
    If by some chance you really are referring to a bound control on your form, then one other possibility is that the underlying field in your linked table is not a normal Boolean data type, but instead is an integer, say, set to something like 1 to represent true and 0 for false.

    Checkboxes respond to the normal MS Boolean states of -1 for True and 0 for False. In fact, the 0 value is not the only one interpreted as False - any value that is not -1 will leave the checkbox shown in an unchecked state. You may then misinterpret the lack of it being checked to mean it is not working correctly, when it is instead not being set from a normal Boolean source.

    You could resolve this by using a Boolean expression like this:

    =([Case]=1)

    or whatever value is involved that really represents True.

    However, my bet would be that you are just using an incorrect lookup as mentioned in the first part of my answer. If so, you really do need to understand that if a field is not bound to the underlying form's recordsource table or query you CANNOT refer to it simply by use of the table name as a qualifier. It does not work like that at all...

    -Stewart

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32634

      #3
      When designing the form, you may need to set the Control Source of the CheckBox control to the required field. In this case it may simply be [Appeal Closed]. I'm rather assuming (for want of any information) that your form is bound to the table or query called [Case].

      NB. A control with the Control Source set like this is often referred to as a Bound control (The form itself must also be Bound of course, which means its Record Source is set).

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32634

        #4
        Another question for your attention Stewart (http://bytes.com/topic/access/answers/866790-dlookup). A very new member posted it in here by mistake.

        Comment

        Working...