dlookup

G

Guest

I'm using the inventory database that came with Access 2003. I created a
report that requires UnitsOnHand be printed. I've tried everything in the
book and I can't get it to work. In the Products Form - Where the
UnitsOnHand is displayed works fine, but when I try to use the same info in a
report or query it will not work. Please help.

Jackson
 
D

Duane Hookom

Do you think you might want to share your DLookup() expression? It's a bit
difficult to help you when we don't know what you tried and "it will not
work" doesn't tell us much.
 
G

Guest

Duane,
Thank for the comeback - My problem is that I'm confused as to the format
for the DLookup function when I'm trying to Lookup a calculated field on a
form.

The inventory database that comes with Access 2003 has a form called
products. On this form is a field called UnitsOnHand that I am trying to
lookup and put in a report. The Products from is based on the Products table
but UnitsOnHand is based on the Product Subform. On the Products Form they
use =[Product Suform].Form![UnitsOnHand], I can recreate it on the Products
form but I can't make it work on my report.

I've tried Dlookup in just about every variation possibe except the right
one. It's my understanding that the layout is:
Dlookup("Field","Table,","criteria= X", but I keep getting either and error
or can't find [Product Subform].Form![UnitsOnHand]. In this case I'm trying
to lookup a calculated field that is not in a table, so what do I put for
TABLE in the DLookup Function?
Jackson
 
D

Duane Hookom

DLookup() will only look up values from a table or query. You need to
determine the calculation for UnitsOnHand that uses values in tables.

--
Duane Hookom
MS Access MVP
--

Jackson said:
Duane,
Thank for the comeback - My problem is that I'm confused as to the format
for the DLookup function when I'm trying to Lookup a calculated field on a
form.

The inventory database that comes with Access 2003 has a form called
products. On this form is a field called UnitsOnHand that I am trying to
lookup and put in a report. The Products from is based on the Products
table
but UnitsOnHand is based on the Product Subform. On the Products Form
they
use =[Product Suform].Form![UnitsOnHand], I can recreate it on the
Products
form but I can't make it work on my report.

I've tried Dlookup in just about every variation possibe except the right
one. It's my understanding that the layout is:
Dlookup("Field","Table,","criteria= X", but I keep getting either and
error
or can't find [Product Subform].Form![UnitsOnHand]. In this case I'm
trying
to lookup a calculated field that is not in a table, so what do I put for
TABLE in the DLookup Function?
Jackson



Duane Hookom said:
Do you think you might want to share your DLookup() expression? It's a
bit
difficult to help you when we don't know what you tried and "it will not
work" doesn't tell us much.
 

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

Top