Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    You need to use the Mid() function as in my posts #9 and #13


    I have tested it. It seems to work!
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  2. #17
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    You need to use the Mid() funtion not Left().
    See my posts #9 and #13

    Sorry. Thought my last post had been lost. Can't see how to delete this one.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #18
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    My error, I went back and copied something -- the wrong something -- Bob was right that Mid() should be used.

    His(Bob) statement should work.
    DUXPrice: IIf(Mid([WBCode],4,1)="X",([WBCost]*2)*(9/10),Null)

    I personally would use
    DUXPrice: IIf(Mid([WBCode],4,1)="X",([WBCost]*2)*(9/10),0)

    but you must also ensure that your WBCost values exist.

    If you get all 0 responses, then your Iif has been found to be False.

    Try again and let us know.

  4. #19
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    I think the OP said that WBCost would never be Null but incase it use:
    DUXPrice: IIf(Mid([WBCode],4,1)="X",(Nz([WBCost],0)*2)*(9/10),0)
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #20
    Rhubie is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    85
    Got it working - thanks a million

    DUXPrice: Round(IIf(Mid([WBCode],4,1)="X",([WBCost]*2)*(9/10),0),1)

  6. #21
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    !!! don't forget to bookmark the link with all the functions with examples !!!

    Glad you got it working.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Character limit in form field
    By tanveerksingh in forum Forms
    Replies: 3
    Last Post: 08-22-2012, 11:04 AM
  2. Prefix character in ID field
    By Zbeibu in forum Access
    Replies: 2
    Last Post: 05-14-2012, 07:21 AM
  3. Replies: 6
    Last Post: 10-28-2011, 11:15 AM
  4. Fixed character length of field
    By tylerg11 in forum Access
    Replies: 3
    Last Post: 09-29-2011, 11:58 AM
  5. Character Limits
    By nashr1928 in forum Reports
    Replies: 5
    Last Post: 12-08-2010, 01:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums