Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    bypass controls based on criteria (2000-SR1)

    On my continuous form, I have three controls, combo box

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: bypass controls based on criteria (2000-SR1)

    if Me.ItemID = 2 Or [ItemID] = 11 Or [ItemID] = 12 Or [ItemID] = 13 Or [ItemID] = 20 Or [ItemID] = 25 Or [ItemID] = 26 Or [ItemID] = 27 Then
    Me.ItemQty = 1
    end if
    if not isNull(me![colorcode]) and (me![qty]=1) then
    RunCommand acCmdRecordsGoToNew
    Me.ItemID .SetFocus
    end if

    I dislike these multiple if statements. They are hard to maintain, and the logic can be difficult to unravel, particularly if you comeback to it after an absence
    In this case I would add another field to the items table. Let's call it bypass, and make it a yes/no field. Make it true for the items where you want to bypass the qty, false for the others.
    Add it as a hidden third column to your combo

    if me.itemID.column(2) = true then ' the numbers are zero based so column(2) is the third one.

    etc
    Regards
    John



  3. #3
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: bypass controls based on criteria (2000-SR1)

    Thanks, so much, John. I will work on that.

    Warren

Posting Permissions

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