Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740

    Unanswered: Teddy: not null... more

    hi again Teddy,
    as always, it is a pleasure to discuss with you (even when this site falls over)

    given four ckbx of which at least one must be checked, does your refinement give unreasonable bias to the nulls:
    nz((True + null + null + null),0) = nz(null,0) = 0
    even tho one ckbx was checked?
    ...whilst
    (nz(True,0) + nz(null,0) + nz(null,0) + nz(null,0)) = True
    even tho three ckbx are null

    i suppose it all depends on the "philosophy" of the form: if the user must deny/confirm all options and confirm at least one option then you way suits; if any one confirm is enough independent of the state of the other options, then my way suits.

    gotta repeat that i didn't try any of these crazy ideas for real!

    izy
    currently using SS 2008R2

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I think you're right there... In fact, the question interested me enough that I coded a coalesce function just for shits. I was surprised that vb doesn't have one. Basically it retunrs the first non-null value. So in situations like this, usage could be:

    If nz(Coalesce(chk1, chk2, chk3, chk4), 0) = 0 Then
    Last edited by Teddy; 06-16-04 at 14:07.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Jun 2004
    Location
    Terrapin Nation
    Posts
    205
    There are a lot of ways to check for submission. The best thing to do is use a combination of custom boolean functions.

    An indespensible peice of code is:


    function LoopForm(frm as form) as boolean

    Dim c as control

    for each c in frm.controls
    select case frm.controltype
    case actextbox

    case accheckbox

    case accombobox
    End select
    next c

    end function





    with variations of this code you can check for completness as well as return contol names which are not complete if you desire.

Posting Permissions

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