Filling in a field based on data in another table

G

Guest

I have two tables: purchase_orders and customers. Both the tables have a
'customer_number' field. In both tables, there is a field called
'customer_name'.

I want this field in the 'purchase_orders' table to be updated with the
corresponding value in the 'customers' table when I fill in a value in the
'customer_number' field. However, if 'customer_number' is left blank, I would
like to be able to fill in the 'customer_name' manually.

So, in short, I would like to be able to generate purchase orders without
NECESSARILY having a customer number.

Any ideas on how to achieve this?

Regards

Baard
 
D

Duane Hookom

Make the Custeomr_Number entry into a combo box with with the second column
of the Row Source returning the Customer_Name. Then in the after update
event of the combo box, use code like:

Me.txtCustomer_Name = Me.cboCustomer_Number.Column(1)

This makes some assumptions regarding your control names.
 

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