A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Lookup Values



 
 
Thread Tools Display Modes
  #1  
Old November 22nd, 2004, 09:35 AM
Wantula
external usenet poster
 
Posts: n/a
Default Lookup Values

I have a combo box (items) on my subform which is using values from the Item
column of the following table (Stock). However, I want it to lookup the
corresponding Unit Price values (when I select an item from the combo box)
and display it in the unit price field on my subform. How do I achieve this?
Stock
Item Quantity Unit Price
Computer 9 2000000
Handbag 50 150000
Jean 20 200000
Jumpdrive 5 500000

  #2  
Old November 22nd, 2004, 10:04 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

Use DLookup(). There is an example in the Northwind sample database.

Open Northwind.
Open the Order Details subform.
Look at the AfterUpdate event procedure for the ProductID combo.

If you need an explanation of how use supply the correct things for
DLookup() see:
Getting a value from a table: DLookup()
at:
http://members.iinet.net.au/~allenbrowne/casu-07.html

BTW, does a Jumpdrive allow your computer to go to warp speed? :-)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Wantula" wrote in message
...
I have a combo box (items) on my subform which is using values from the
Item
column of the following table (Stock). However, I want it to lookup the
corresponding Unit Price values (when I select an item from the combo box)
and display it in the unit price field on my subform. How do I achieve
this?
Stock
Item Quantity Unit Price
Computer 9 2000000
Handbag 50 150000
Jean 20 200000
Jumpdrive 5 500000



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing LOOKUP values mpjohnston General Discussion 3 August 28th, 2004 09:32 PM
Please help! How can I use Lookup() command if values are not in ascending order? rruzicka Worksheet Functions 4 August 23rd, 2004 06:55 PM
VLOOKUP lookup values as range Andy Brown Worksheet Functions 2 March 29th, 2004 12:25 AM
lookup a sum of multiple values for a single date Mic Worksheet Functions 2 October 22nd, 2003 05:52 PM


All times are GMT +1. The time now is 06:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.