Connecting Tech Pros Worldwide Forums | Help | Site Map

D-Lookup

Member
 
Join Date: Mar 2008
Location: Doylestown, PA
Posts: 44
#1: Jul 5 '09
I have a ton of DLookup results in by database and it works great.

However I just built a pop up form (fmswo) that I am using as a worksheet while viewing a invoice and when I click on the combo box (cbomesh) the choice comes up properly but populates the first value in the table where it is stored.

what I have:

where value is stored to be lookup up - "tblinventory"
field name to look up - "sellprice"
"cbomesh" control is - "meshtype"
combo box name = "cbomesh"

what I am using is:

=DLookUp("[SellPrice]","[tblinventory]","[meshtype] = '" & [cbomesh] & "'")

NOTE: It does not return an error but returns the "sellprice" of the product in the first record of "tblinventory"

I have tried countless combinations of solutions with no success.

Please help very frustrated with somthing that is probably very simple.

thanks
Gary

ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,223
#2: Jul 5 '09

re: D-Lookup


Quote:

Originally Posted by GLEberts View Post

I have a ton of DLookup results in by database and it works great.

However I just built a pop up form (fmswo) that I am using as a worksheet while viewing a invoice and when I click on the combo box (cbomesh) the choice comes up properly but populates the first value in the table where it is stored.

what I have:

where value is stored to be lookup up - "tblinventory"
field name to look up - "sellprice"
"cbomesh" control is - "meshtype"
combo box name = "cbomesh"

what I am using is:

=DLookUp("[SellPrice]","[tblinventory]","[meshtype] = '" & [cbomesh] & "'")

NOTE: It does not return an error but returns the "sellprice" of the product in the first record of "tblinventory"

I have tried countless combinations of solutions with no success.

Please help very frustrated with somthing that is probably very simple.

thanks
Gary

Kindly post the Row Source of cboMesh.
missinglinq's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,002
#3: Jul 5 '09

re: D-Lookup


Quote:

Originally Posted by GLEberts View Post

...when I click on the combo box (cbomesh) the choice comes up properly but populates the first value in the table where it is stored.

It sounds to me as if the your combobox is bound to the field in the table it pulls from, which it shouldn't be for this type of thing. Is a field listed in the Combobox Control Source?

Linq ;0)>
Member
 
Join Date: Mar 2008
Location: Doylestown, PA
Posts: 44
#4: Jul 5 '09

re: D-Lookup


update:
the table name is: "products" not "tblinventory"

the row source is -
SELECT [Products].[ProductID], [Products].[ProductName] FROM [Products] ORDER BY [ProductName];
Member
 
Join Date: Mar 2008
Location: Doylestown, PA
Posts: 44
#5: Jul 5 '09

re: D-Lookup


Quote:

Originally Posted by missinglinq View Post

It sounds to me as if the your combobox is bound to the field in the table it pulls from, which it shouldn't be for this type ofthing. Is a field listed in the Ccombobox Control Source?

Linq ;0)>


the combo box is bound to table: tblswo
the field name = "meshtype" displays in the combo box (cbomeshtype)

yes the field "meshtype" is listed in the Ccombobox control source.

thanks
Gary
Member
 
Join Date: Mar 2008
Location: Doylestown, PA
Posts: 44
#6: Jul 8 '09

re: D-Lookup


I got the problem sorted out.
Thanks
Reply