Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004

    Unanswered: combo box list box


    i have have a combo box that list model numders bound to productid. what i want to do is select a model number and have the price diplayed in invoice price text box.

    the code i have written is

    strfilter = "productid=" & me!productid

    me!invoiceprice = dlookup ("invoice price", "products", strfilter)

    the error message i recieve is can't find field invoiceprice.

    any help would be greatful thanks

  2. #2
    Join Date
    Nov 2002
    I would make that control source a query and base the predicate on the other control

    I never used dlookup for this

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    If you have a single price for the item, you could consider adding it to the row source of the combo / list box.
    This wouldn't work though if you had more than one price for the item.
    It wouldn't be a smart idea if you have a large numnber of products on the list box, nor is it 'smart' to have more columns than required in the list box

    so lets assume that you added the invoiceprice to the rowsource for the combobox then you can pick up the price from the relevant column.

    me!invoiceprice = me!productid.column(x) 'where x is the order the invoiceprice is in the row source for the combo box

    IMnsHV domain functions may have a good use in VBA, but I haven't found one yet.

  4. #4
    Join Date
    Dec 2003
    Dallas, TX
    Hi carash77ash.....

    Why don't you just in your Table a Product Field and a Price Field for that product. Then when you make your ComboBox and Select the Product, the Price for that product automatically comes up. See the small sample I attached that does just what I'm talking about. At least it seems that is what you are wanting.

    have a nice holiday!!!
    Attached Files Attached Files

Posting Permissions

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