Results 1 to 6 of 6
  1. #1
    Join Date
    May 2008
    Posts
    6

    Unanswered: How to get data in a form to populate from a query?

    So like in my other post I am a total noob at access, so if you can please post accordingly.

    I have a form used for QA in a Call Center, I have made a Query that pulls data out of the database and gives me a % based score, now I need to get this score back into the same form that gave the information to create that score.

    Sooo

    I think this is the right code but how can my form know what the correct row is? That might be why I get a #Name? Error?

    =[Score calc]![Score Total]

    Or do I need to use something like this?

    =DLookup ("[Score Total]", Score calc , _ "[ID] = Form![ID]")

    Useing both of the functions I always get that #Name? error, do I need to be placeing the code somewhere other than the Control Source?

    Also this data is being created live, meaning the Score field will need to change as the user modifies a set of Combo Box's.

    Any Ideas?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    If the query is only returning the one record:

    =DLookup("[Score Total]", "[Score calc]")
    Paul

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    =forms![Score calc]![Score Total] might give you what you want too.... if I am reading this right.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    May 2008
    Posts
    6
    My Query is pulling more than one but I did try it anyhow,

    =DLookUp("[Score Total]","[Score calc]")

    Gave me a result of 10000% for some reason.


    Now,

    =forms![Score calc]![Score Total]

    Gives me a error and then changed the function to

    =[Forms]![Score calc]![Score Total]

    Any other ideas? Or do I need to give you guys some more info?

  5. #5
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    More info would help. If the query returns multiple records, you'll need a criteria. Good reference here:

    http://www.mvps.org/access/general/gen0018.htm
    Paul

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Nup, I wasn't reading that right

    Paul has set you on the right path though
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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