I got the valued, but it fix valued from the first field of "Products" table,
it did not changed accordingly to each product. Different product has
different weight which specific in "Products" table. How can I fix this,
function might be wrong somewhere? Please help. Thanks.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200912/1
I got the valued, but it fix valued from the first field of "Products" table,
it did not changed accordingly to each product. Different product has
different weight which specific in "Products" table. How can I fix this,
function might be wrong somewhere? Please help. Thanks.
--
Message posted via http://www.accessmonster.com
> Hi, I try to get the value of "Net_Weight" from "Products" table and my
> DlookUp function key as this =DLookUp("[Net_Weight]","Products","[ID]")
>
> I got the valued, but it fix valued from the first field of "Products"
> table, it did not changed accordingly to each product. Different product
> has
> different weight which specific in "Products" table. How can I fix this,
> function might be wrong somewhere? Please help. Thanks.
>
The final argument needs to be the same as a WHERE clause in a query (only
without the word "WHERE"). Does this query makes sense?
SELECT Net_Weight
FROM Products
WHERE ID
You need to specify something about ID like...
SELECT Net_Weight
FROM Products
WHERE ID = 1234
If you are using this DLookup() on a form and you want the value where ID
matches a field named ID on the form then try...
=DLookUp("[Net_Weight]","Products","[ID] = " & Me.ID)
Yes, I use it on the form, I did try out =DLookUp("[Net_Weight]","Products","
[ID] = " & Me.ID), but it still did not work. Error message shows #Name?
Thanks.
Rick Brandt wrote:
>> Hi, I try to get the value of "Net_Weight" from "Products" table and my
>> DlookUp function key as this =DLookUp("[Net_Weight]","Products","[ID]")
>[quoted text clipped - 4 lines]
>> different weight which specific in "Products" table. How can I fix this,
>> function might be wrong somewhere? Please help. Thanks.
>
>The final argument needs to be the same as a WHERE clause in a query (only
>without the word "WHERE"). Does this query makes sense?
>
>SELECT Net_Weight
>FROM Products
>WHERE ID
>
>You need to specify something about ID like...
>
>SELECT Net_Weight
>FROM Products
>WHERE ID = 1234
>
>If you are using this DLookup() on a form and you want the value where ID
>matches a field named ID on the form then try...
>
>=DLookUp("[Net_Weight]","Products","[ID] = " & Me.ID)
--
> Hi,
>
> Yes, I use it on the form, I did try out
> =DLookUp("[Net_Weight]","Products","
> [ID] = " & Me.ID), but it still did not work. Error message shows #Name?
> Thanks.
Does your form have a control or bound field named "ID"?
What is the name of the control you are putting the DLookup() expresson in?
It cannot be the same as any of the operands in your expression.
If ID is a text field then
=DLookUp("[Net_Weight]","Products","[ID] = """ & Me.ID & """")
is the correct expression to assign to a control.
If you are trying to use this in a query then you would need to drop the
equals sign at the start of the expression.
If Me.ID is null and the ID field is a number field then you might need
=DLookUp("[Net_Weight]","Products","[ID] = " & Nz(Me.ID,0))
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Table "Products" ID is a number value not text. I did try all the suggested
expression but it still cant solve the problem... What should I do? Thanks..
John Spencer wrote:
>If ID is a number value then
> =DLookUp("[Net_Weight]","Products","[ID] = " & Me.ID)
>is the correct expression to assign to a control.
>
>If ID is a text field then
> =DLookUp("[Net_Weight]","Products","[ID] = """ & Me.ID & """")
>is the correct expression to assign to a control.
>
>If you are trying to use this in a query then you would need to drop the
>equals sign at the start of the expression.
>
>If Me.ID is null and the ID field is a number field then you might need
> =DLookUp("[Net_Weight]","Products","[ID] = " & Nz(Me.ID,0))
>
>John Spencer
>Access MVP 2002-2005, 2007-2009
>The Hilltop Institute
>University of Maryland Baltimore County
>
>> Hi,
>>
>[quoted text clipped - 24 lines]
>>>
>>> =DLookUp("[Net_Weight]","Products","[ID] = " & Me.ID)
--
--
> No. I dont have any name "ID" in form. "Nett Wt" is the name of the field
> that I want DLookup to fill in the value.
Yes, but what field or control on the form can be used in the WHERE clause?
You have a table with multiple rows and you have to specify to the DLookup()
function which row you want to pull the value from. That is the purpose of
the third argument. You need to tell the function which ID value in the
table specifies the row you want it pull the Nett Wt from.
Is there something on your form that can provide that information?
=DLookUp("[Net_Weight]","Products","[ID] = " & [ID])
where ID is the name of the Products table's primary key column, and the name
of the corresponding foreign key column in the form's underlying table.
Ken Sheridan
Stafford, England
Coco111 wrote:
>No. I dont have any name "ID" in form. "Nett Wt" is the name of the field
>that I want DLookup to fill in the value.
>
>>> Hi,
>>>
>[quoted text clipped - 7 lines]
>>What is the name of the control you are putting the DLookup() expresson in?
>>It cannot be the same as any of the operands in your expression.
--
Message posted via http://www.accessmonster.com
Bonnie
http://www.dataplus-svc.com
Thanks for your all effort and guide along.
I got it. In my form the name "Product ID" is the specific the row that want
as below criteria.
=DLookUp("[Net_Weight]","Products","[ID] = " & [Product ID])
Thanks so much....coco
--