View Single Post
  #3  
Old May 26th, 2004, 03:52 AM
ChrisJ
external usenet poster
 
Posts: n/a
Default Cry For Help! - Filling In Forms Automatically From Tables

You have a recordsource for your combobox. Probably
something like
"Select productId from tblProduct;"
Change this to
"Select ProductId, ProductName, UnitPrice from tblProduct;"
Change the columnCount and columnwidth properties of the
combobox to match.

in the combobox click event put code like

if cboProduct.listindex 0 then exit sub
txtPName.value = cboproduct.column(1,cboproduct.listindex)
txtUnitPrice.value = cboproduct.column
(2,cboproduct.listindex)




-----Original Message-----
I am DESPERATE for a quick reply.. have exhausted my

options...

i have a table called order details which contains:

order id
product id
product name
quantity
unit price
sale price
discount

and a products table containing:
Product id
product name
unit price
units in stock

I have a form which currently shows text boxes for
order id
product id
product name
quantity
unit price

(product id is a combo box)

i can choose the product id from the drop down i have

created but it does
not put any other data into any of the other fields.. how

on earth EXACTLY
can i manage to do this? i want the data from the product

table to fill in
the form once i choose the product id from the form combo

box

cheers for ANY help



.