Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    47

    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.

    Thanks

    Andy

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,469
    Provided Answers: 10
    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
    or
    WHAT = "[PRODUCTID]='" & me.combo & "'" ' for text
    hope this help

    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •