Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Unanswered: COmbo Box on query -IIf

    Hi.

    I set combo box have 2 items: Delivery and Self-fetching.
    but when I make a query, what I want to do is if delivery is required, then charge should be applied for this delivery.
    but if delivery is not required, charge fileld show 0.

    I put the criteria IIF(Field=Delivery, Charge rate ,"0")


    From the funtion, just all delivery order was appeared, no Self-Fetching.

    Can anyone help me to solve this problem? Cheers.

    ***
    Charge rate is extracted from other query

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    It's backwards, and you have some sytax problems:

    IIF([Field]="Delivery",0,[Charge rate])

    Use brackets to indicate field names. If you get into this practice, your code will not be an indistiguishable jumble of words. Fields will be easily recognizable by the brackets and everything else are variables.
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  3. #3
    Join Date
    Jan 2004
    Posts
    53
    Originally posted by PracticalProgram
    It's backwards, and you have some sytax problems:

    IIF([Field]="Delivery",0,[Charge rate])

    Use brackets to indicate field names. If you get into this practice, your code will not be an indistiguishable jumble of words. Fields will be easily recognizable by the brackets and everything else are variables.

    Hi,

    I think the logic is orginally correct and should read

    IIF([Field]="Delivery",Charge rate], 0)

    She said "If delivery then Charge Rate else 0"

    "I set combo box have 2 items: Delivery and Self-fetching.
    but when I make a query, what I want to do is if delivery is required, then charge should be applied for this delivery.
    but if delivery is not required, charge fileld show 0. "


    Jason
    Jason

Posting Permissions

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