Results 1 to 3 of 3

Thread: checkbox hell

  1. #1
    Join Date
    May 2009
    Posts
    72

    Unanswered: checkbox hell

    hi
    I have really gone beyond in getting this work
    i have a checkbox which should get checked if values in two textboxes are equal
    i have coded
    on form current()
    If Me.QTY.Value = Me.TQA.Value Then
    Me.POSUBMATLSTATUS.Value = True
    Else
    Me.POSUBMATLSTATUS.Value = False
    End If

    QTY gets its value from query
    TQA IS A unbound textbox which gets the total quantity using DSUM

    PLEASE HELP ME

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    First thing that occurs to me is the appropriateness of doing it in OnCurrent. I would do it BeforeUpdate.

    If Me.QTY.Value = <ValueCalculatedUsingDSum()> Then
    Me.POSUBMATLSTATUS.Value = True
    Else
    Me.POSUBMATLSTATUS.Value = False
    End If
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Are both values exactly of the same type? You should try using a conversion function (CString, Cint or I don't know which, it depends on the data types), just to be sure. e.g.,
    Code:
    If CLng(Me.QTY.Value) = CLng(Me.TQA.Value) Then
    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
  •