Auto fill

G

Guest

I have a form that contain fields like Customer ID, Customer Name, Transaction Date, Address, Product, etc
This data entry form updates a new record into the New Order table and it works
My problem is how to auto fill the Customer Name in the form, when the Customer ID is entered int
the form so that the "Data Entry Person" can check that indeed the customer ID corresponds to the Custome
Name . Once the customer name appears on the form this should update into the new order table

I created a combo box on the record source properties field of the form which pulls the customer names fro
a master customer table and the result creates a combo box drop down key which gives you a choice of the customer wit
the correponding customer ID. What I need is to have the customer name auto fill once the Customer ID is entered into the form automatically which saves on the data entry process and verifcation of the customer ID. Can you show how to d
this please

Thanks for any help
 
N

Nikos Yannacopoulos

Several ways.

In my view VB is always preferable; use the on change
event of the Customer ID box to fire some simple code that
either (a) opens Customer Master as a recordset, finds
the record, or (b) DLookUp's the other customer fields in
Customer Master and, in either case, sets the text boxes
on the form to the other field values.

If you don't want to use VB, you can use the on change
event again to run a macro with a SetValue action for each
of the other text boxes, the argument being something a
DLookup again.

HTH,
Nikos
-----Original Message-----
I have a form that contain fields like Customer ID,
Customer Name, Transaction Date, Address, Product, etc.
This data entry form updates a new record into the New Order table and it works.
My problem is how to auto fill the Customer Name in the
form, when the Customer ID is entered into
the form so that the "Data Entry Person" can check that
indeed the customer ID corresponds to the Customer
Name . Once the customer name appears on the form this
should update into the new order table.
I created a combo box on the record source properties
field of the form which pulls the customer names from
a master customer table and the result creates a combo
box drop down key which gives you a choice of the customer
with
the correponding customer ID. What I need is to have the
customer name auto fill once the Customer ID is entered
into the form automatically which saves on the data entry
process and verifcation of the customer ID. Can you show
how to do
 
T

Tony

I am new to access. Can you guide me how to do the Dlookup
expression to make this work. Thanks for your helf
 
N

Nikos Yannacopoulos

Tony,

The expression syntax is like this:

=DLookUp("[Customer Name] ","tblCustomers","[Customer ID] =[txtCustID]")

where Customer Name is the name of that field in your table, tblCustomers is
the name of the table, Customer ID is the field name in the table and
txtCustID is the name of the customer ID text box on your form. Substitute
as appropriate.

Regards,
Nikos
 

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