Passing data from a List box select

J

Jai_Friday

Simple query I hope..

I have a customer database in access that is connected to a simple Customer
select form..

there are 3 boxes

a list box to select the customer (from a complete list customers and has a
customer code, customer name and customer status, the customer code is the
bound column)
Customer Code text box
Customer Name text box

What I would like to achieve is upon selecting a customer the customer code
is past down the the customer code text box (which it does)
and the Customer name past down to the Customer Name Text box

I attempted to created a select statment in the control source of the
Customer Name text box which doesn't error or return the right data.

The statement I tried was Select Customer_Main.Name FROM Customer_Main
WHERE (Customer_Main.Code=Customer_List_Box)

Thank in advance if you can help..

Jai
 
S

scubadiver

You cant put a select statement in a text box!!

If you are already binding the customer code number in the list box why send
it to the customer code box. There is no point in storing it twice ???

What you need to do in the list box is have a query that selects the
customer code and customer name (which you make invisible by setting the
column width to 0cm in the format tab in the properties).

In the after update event of the list box type:

customername = customerlist.column(1)

This will store the customer name in the text box.
 

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