Results 1 to 10 of 10
  1. #1
    cp1981 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Northeast Missouri
    Posts
    33

    Need help on Dlookup within query

    Greetings.

    Problem: Trying to use DLookUp in a query from a query

    Info: I have two tables, tblAccount and tblCategory.
    tblCategory refers to an average household "bill" (e.g. "gas", Water", "electric", etc)
    tblAccount refers to a specific company
    I have a relationship where tblCategory displays many Accounts.

    I also have a query, qryAccountExtended.
    It shows the following fields AccountID, Account, CategoryID, Category, Amount, DueDate, Income/Expense, IsRecurring (Yes/No)

    Desired Result: To have a query that displays the recurring expense account, amount, due date.

    Eventually I want to use this for a dashboard form that lets me know what recurring accounts that need to be paid and when.



    If yall need more info, just let me know.

    Thanks in advance.

    Clint

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,631
    How is this requirement related to a DLookup expression?

    What is preventing you from building the query?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    cp1981 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Northeast Missouri
    Posts
    33
    Quote Originally Posted by June7 View Post
    How is this requirement related to a DLookup expression?
    If you are referring to my "desired result", then I believe in theory (non-expert talking here) I would be able to use this query along with others to develop a notification dashboard on what recurring accounts are not paid or that are due and what aren't.

    What is preventing you from building the query?
    Basically my inexperience. To be completely honest, Id like for someone to look at the schematics of my db thus far and see what Ive done....to see if its a solid/sound db. I get the results I want to see through other forms, tables, and my other query, but to my knowledge of their worthiness, Im living on hope.

    My next question...Why are the St. Louis Cardinals so good? lol

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,631
    I still don't know what you want. How would a DLookup help produce desired result?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    cp1981 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Northeast Missouri
    Posts
    33
    Database141.zip

    Hope it all works out.

  6. #6
    cp1981 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Northeast Missouri
    Posts
    33

    Thumbs up

    Hey! Figured it out...took me a lil while. I was WAY overthinking everything. Sorry for the trouble. Good day to yall...Im sure Ill be back for more questions lol

  7. #7
    cp1981 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Northeast Missouri
    Posts
    33
    Ok...sooooo I thought I had it. The expression I have doesnt work entirely, it returns the same account over and over as well as leave other fields filled with their information. I dont know if it's how the expression is written or possibly something going on with my tables and their relationships.

    I have a query that runs my Accounts table. In my Accounts table, I have expense accounts and I have an IsRecurring field with a Yes/No box. Also within my Accounts table, I have PaymentDate, DueDate, Amount, and Category in my query. I have another table Category that has a one-to-many with ref. integrity between the CategoryID and the Category field of Accounts.

    What I want the query to do is return all the accounts and their respective PaymentDate, DueDate, and Amount when IsRecurring is checked.

    Heres what I have:

    Code:
    RecurringAccount: DLookUp("[Account]","tblAccount","[IsRecurring] = True")

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,631
    Then don't understand why you are using a DLookup expression in attempt to apply filter criteria. Just put criteria under the IsRecurring field of: True

    There are no records in tblAccount or tblTransaction. Makes it a little difficult to test. I would have to create records.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    cp1981 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Northeast Missouri
    Posts
    33
    Wow...Im just....speechless. So easy. I knew, again, I was overthinking . Just curious, why wont Dlookup expression work? Is it because the query builder is designed that way? Much thanks to you June7. Wish I could borrow your expertise for about a week or so then give it back.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,631
    DLookup makes no sense in this situation. You want records in tblAccount where IsRecurring = True - simple filter criteria. Has nothing to do with the Access query builder. It is the nature of SQL. Could type SQL statement in the SQL View but that can be frustrating. The Access query builder is a tool to help get SQL syntax correct.
    Last edited by June7; 07-25-2014 at 10:08 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. DLookup Query
    By Pure Salt in forum Access
    Replies: 5
    Last Post: 06-13-2014, 02:35 AM
  2. Dlookup in query
    By Bertrand82 in forum Queries
    Replies: 9
    Last Post: 11-14-2012, 06:42 AM
  3. DLookup in Query
    By mfrey40 in forum Queries
    Replies: 3
    Last Post: 12-27-2011, 12:41 AM
  4. Query with Dlookup
    By mari_hitz in forum Queries
    Replies: 5
    Last Post: 10-14-2011, 09:22 PM
  5. Query Dlookup different fields
    By newwales in forum Access
    Replies: 1
    Last Post: 07-07-2011, 10:13 AM

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