how do i pull information from customer table to order form

G

Guest

I have a database that has 4 tables. "customers" key customer id linked to
"orders" customer id. "orders" keyorder id linked to "order_detail" order
id. "products" key product_id linked to "order_detail" products id. how do i
create an order form that will auto fill customer information when i input
customer id? also product information when i input product code?
 
G

Guest

The simplest way is to return all required customer information to columns in
a combobox. Have the combobox show only the field(s) you want visible and
hide the rest by using the ColumnWidths property. Make sure the CustId column
is set as the bound column. In the combobox's AfterUpdate event, you'll take
the values from the other columns and put them into the other controls on
your form. You can do this with a macro or with VBA. If you're using a macro,
you can use the SetValue action to put the values out. You'll also need to
use the combobox's Columns collection to reference column values. For
example, if the selected row of the combobox has these values in the columns:

17, "Acme Motors","15 Main Street","Anytown", "NY","11004"

you would use MyCombo.Column(3) to get the value "AnyTown". You should
remember that columns are zero-based, meaning the first column is 0.

Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top