Thread: Some help please DLookUp etc
03-21-04, 18:06 #1Registered User
- Join Date
- Mar 2004
Unanswered: Some help please DLookUp etc
Guys I could use some help, I'm very new to Access and I'm trying to pull together some basic business applications.
I have a combo-box in a subform where I can select a Product, depending upon the Product selected I want 2 other fields in the Subform to be automatically updated with the correct valus associated with the product - the Product Reference, and the Products Buying Price.
I thought about using DLookUp to get the values from the Product Table, based upon the Product selected from the combo-box, however, how to I get the it to looup when the product changes or only when there is a value in the product field.
Any ideas/answers would be appreciated.
03-21-04, 20:24 #2(Making Your Life Easy)
Provided Answers: 10
- Join Date
- Feb 2004
- New Zealand
Yes You can use Dlookup
But I Wouldn't as you have the data haft there
Why not just use the combo-box
if you add the Columns you want to the combo-box and set the widths to 0 so you don't see them
just add the columns to the query
then what you can do is in the afterupdate!combo-box
me.otherfeild = me.combo-box.Column(??)
?? where it is the Column number you want
But the To use a Dlookup
BlaBla = Dlookup("FEILDNAME","TABLENAME","WHAT")
WHAT = "[PRODUCTID]=" & me.combo ' for a number
WHAT = "[PRODUCTID]='" & me.combo & "'" ' for texthope this help
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
VB-NET based on my own environment started 2007
SQL-2005 based on my own environment started 2008
YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
THEY'RE BEHIND YOU FOR A REASON