In forms; code entered how can automatically display related info

G

Guest

I am creating a work database and we use codes for customer's and their
information so I want to be able to enter a code that relates to a customer's
name, address and postcode. When the code is entered or selected from a list
(in a form) I want the related customer's information (name, address,
postcode) to automatically appear beside the code and to be saved with the
record once all the details have been entered.

Can anyone help me please?
 
S

Svetlana

In fact you don't need to save the customer's informations again n
again as they are already saved in the customers table.
If you save the CustomerID then its like you save his informations too.

You only need a way to show current customer's informations.
There are many ways to do that.

You could create a query based on customer's table, make combinations
of fields (like a field named fullname that its the combination of
first, middle and last name) or short customers in the order you want
to be shown in the drop down list (as alphabetical LastName, FirstName
or whatever), then create a combobox based on this query (inclucing all
its fields). Put as controlsource of the combobox the CustomerID. You
can make it look as you like, presenting the full name of the customer
instead of a number ID hidding these columns you don't want to be
visible setting the ColumnWidths property to 0 for them).Finally there
where you want to show each particular information as customer's adress
you just need to put as controlsource of the Address textbox
=NameOfCombobox.Column(Number).
Where Number=NumberOfColumnThatHoldsTheAdress - 1
 
G

Guest

Hi Melisa

Just a thought are the codes unique to each cutomer or do some customers
have the same codes. If they are unique do you use them as the primary field?
 

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