Results 1 to 6 of 6
  1. #1
    cardonaj8 is offline Novice
    Windows XP Access 2013
    Join Date
    Jun 2015
    Posts
    3

    IIF & Dlookup Formula

    All,



    i don't even know what i am trying to do is possible..... i Have an account number in my sales report that belongs to the company ( that our dealers can use when their account is low on funds and they rather pay us with a check ). Nonetheless i have a crosstab query that shows each sales rep their daily sales. I have Dlookup formulas looking at the account umber to notify what rep gets what sale.

    I have a CEPOData query that has the general account inforamtion and has it seperated by the actual delaer and their information.

    My ulitmate goal is to create an IIF function that states ( IIF the customer # ID has ( 30220992 ) " this is the generic account" ... dlookup in "QryCEPOData" , PO Number against CUst PO # ..... ( i want this to give me the actual account number for this specific sale ) but i also need the false dlookup formula to say if the customer IS isn't " 30220992" leave the origianlformula alone .

    i have no idea if i make any sense but i created the below:






    IIF([Br Cust #="30220992"( DLookUp("[Sales Rep]","QryCEPOData","[PO Number]='" & [Cust PO #], DLookUp("[Sales Rep]","tblmastercustomerlist","[ACCOUNT NUMBER]='" & [Br Cust #] & "'")


    any help or gudience would be great thankyou

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    I'm not clear on what you're trying to achieve, but there are several syntax errors in your effort. Try

    IIF([Br Cust #]="30220992",DLookUp("[Sales Rep]","QryCEPOData","[PO Number]='" & [Cust PO #] & "'"), DLookUp("[Sales Rep]","tblmastercustomerlist","[ACCOUNT NUMBER]='" & [Br Cust #] & "'"))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cardonaj8 is offline Novice
    Windows XP Access 2013
    Join Date
    Jun 2015
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    I'm not clear on what you're trying to achieve, but there are several syntax errors in your effort. Try

    IIF([Br Cust #]="30220992",DLookUp("[Sales Rep]","QryCEPOData","[PO Number]='" & [Cust PO #] & "'"), DLookUp("[Sales Rep]","tblmastercustomerlist","[ACCOUNT NUMBER]='" & [Br Cust #] & "'"))


    I will try this on Monday when I am back in the office. My main goal is..... if the field has accnt number 30220992, i need access to dlookup the sales rep by the po order in qrtcepodata by the field classified as po number in that qry that matches the customer po number in the current qry. If the act number isn't 30220992 , i need access to find the sales rep by the proper account nunbers.

    Thank you so much for your help.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    No problem, post back if that doesn't work. Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    cardonaj8 is offline Novice
    Windows XP Access 2013
    Join Date
    Jun 2015
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    No problem, post back if that doesn't work. Welcome to the site by the way!

    Thank you so much it worked!!!

    now i have one more question is their a specific formula to have a report focuse on the current date ( i need my qry to have the sales for the month and one for a the current date but i don't know te formula for that. )

    if you knwo it i would highly appreciate that.


    thank you thank you thank you again for your help.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    The Date() function will return the system date; is that what you're looking for?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  2. IRR Formula in VBA
    By Mpike926 in forum Access
    Replies: 2
    Last Post: 05-19-2015, 02:48 PM
  3. Please help with formula
    By JeanZander in forum Database Design
    Replies: 2
    Last Post: 01-07-2013, 04:39 PM
  4. Please help with this formula.
    By vickan240sx in forum Access
    Replies: 3
    Last Post: 09-17-2012, 03:44 PM
  5. *URGENT HELP NEEDED* DLookUp Formula
    By iProRyan in forum Forms
    Replies: 1
    Last Post: 03-28-2012, 11:55 AM

Tags for this Thread

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