Results 1 to 8 of 8
  1. #1
    Join Date
    May 2007
    Posts
    13

    Unanswered: Return Query to Form

    Hello All,

    I am fairly new to Access and am running into a slight problem. I have a form that has a drop down list where a user selects which lift station he wants. He also enters in how many hours that lift station was operating for that day. I have a query based on this Lift Station selection and a pump rate table. The query returns the pump rate for the selected Lift Station (see form.doc)
    form.doc

    I want to take the result from the Query (Pump1Pumprate) and multiply it by Pump #1 Total Hours * 60 to get Pump #1 Volume. If I use the expression builder with my Query selected, I get the #Name? message in the Pump #1 Volume box (see expression.doc)
    expression.doc

    I hope I have given enough info. What am I doing wrong?

    I thank you in advance for any help you can give,

    Daniel

  2. #2
    Join Date
    Aug 2006
    Posts
    559
    Is there a way you can zip and upload your db so we can take a look at it?

  3. #3
    Join Date
    May 2007
    Posts
    13
    Here is the MBD engineering.zip

    Thanks for looking it over.

    Daniel

  4. #4
    Join Date
    Aug 2006
    Posts
    559
    I just took a look at the db. How come you have so many queries that do not do anything? It seems unnecessary to me. I'm still looking at your current issue though.

  5. #5
    Join Date
    May 2007
    Posts
    13
    You are right. The only queries that really need to be there are PumpRate1 and PumpRate2. The others were just created as tests that I failed to remove.

  6. #6
    Join Date
    May 2007
    Posts
    13
    Ok, I think I found the solution with dlookup. In the Pump #1 Volume field of the first record it will display the correct pump rate. However, this same figure is displayed in all records.

    my control source for this field is: =DLookUp("[Pump1PumpRate]","[PumpRate1]")

    my default value for this field is exactly the same.

    What do I need to do to update this field with the correct value?

    thanks for the help

  7. #7
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Well, you've told it to look up a pump rate in the PumpRate1 table/query. You haven't asked it to look for any particular one, so it just grabs the first one.

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

  8. #8
    Join Date
    May 2007
    Posts
    13
    I got it figured out by setting the control source
    =DLookUp("[Pump1PumpRate]","[Lift_Station]","[Lift_Station]![LiftName]= [PumpRecords]![Lift Station]")


    I thank you all for your help,

    Daniel

Posting Permissions

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