DLookup-retrieves only 1st record in query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to pull records from a query, into a form. The first record in
the query appears for every record in the form.

My expression is . . .

=DLookUp("[Customs Value and Duty Totals]![SumOfValue]","Customs Value and
Duty Totals","[Customs Entries]![Entry Number]=[Customs Value and Duty
Totals]![Entry Number]")

This expression is working for records I pull from tables, but not from this
query.

Any thoughts?
 
In the control source of a text box in the form where you want the output of
the query to be displayed, try and write something like

=DLookUp("[SumOfValue]","[Insert here the Query Name]","[Entry Number field
name in query]= "& [Entry Number field name in form])

If the is string try
=DLookUp("[SumOfValue]","[Insert here the Query Name]","[Entry Number field
name in query]= '" & [Entry Number field name in form] & "'")
 
Nope . . . not working. I either get an error or totally blank.
--
Thanks,
Theresa


Ofer said:
In the control source of a text box in the form where you want the output of
the query to be displayed, try and write something like

=DLookUp("[SumOfValue]","[Insert here the Query Name]","[Entry Number field
name in query]= "& [Entry Number field name in form])

If the is string try
=DLookUp("[SumOfValue]","[Insert here the Query Name]","[Entry Number field
name in query]= '" & [Entry Number field name in form] & "'")

--
\\// Live Long and Prosper \\//
BS"D


tscelica said:
I'm trying to pull records from a query, into a form. The first record in
the query appears for every record in the form.

My expression is . . .

=DLookUp("[Customs Value and Duty Totals]![SumOfValue]","Customs Value and
Duty Totals","[Customs Entries]![Entry Number]=[Customs Value and Duty
Totals]![Entry Number]")

This expression is working for records I pull from tables, but not from this
query.

Any thoughts?
 
It's probably because of the spaces in the second parameter. If you're going
to insist on using spaces, you need to enclose the name in square brackets:

=DLookUp("[Customs Value and Duty Totals]![SumOfValue]","[Customs Value and
Duty Totals]","[Customs Entries]![Entry Number]=[Customs Value and Duty
Totals]![Entry Number]")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Special characters 3
DLookUp #Error 7
DLookUp for an Alphanumeric Record 3
DLookup and Nz 0
Dlookup error 4
Pulling data from date range query 2
"Read Only" Query 0
Formating Issue in a Query 1

Back
Top