Fill in form utomatically

M

microsoft

I would like to type in an ID number and have fields such as Name Address
fill automatically
Is there a way to do that?
I need detailed inf on how
I am new to access.
Thanks
Mark
 
R

Roger Carlson

A good place to start is the Northwind database that comes with the
installation of Access.
 
P

PC Datasheet

Mark,

Typing in an ID number is not the way to do it!

Your table should look like:

TblCustomer
CustomerID
FirstName
LastName
Address
City
State
Zipcode

Create a query based on TblCustomer with these fields:
CustomerID
FirstName
LastName
Address
City
State
Zipcode

Sort on LastName

Put textboxes on your form for each of the fields in TblCustomer except
CustomerID and name the textboxes the same as the field names. Create a combobox
on your form based on the above query and name it CustomerID. Select your
combobox in design view and set the following properties:
Bound Column 1
Column Count 7
Column Width 0;1.5;1.5;0;0;0;0

Put the following code in the AfterUpdate event of the combobox:
Me!FirstName = Me!CustomerID.Column(1)
Me!LastName = Me!CustomerID.Column(2
Me!Address = Me!CustomerID.Column(3)
Me!City = Me!CustomerID.Column(4)
Me!State = Me!CustomerID.Column(5)
Me!Zipcode = Me!CustomerID.Column(6)
 

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