Auto filling fields

G

Guest

I am trying to get subsequent fields to fill in when a previous field is
filled. (e.g. put in a person's name and their address automatically fills in
the next field) I have a table full of the data already, and I can't figure
out how to do this. Thanks.
 
C

chris.nebinger

Why would you?

Lets say you have a customer table. In that, you have a customer ID
field that is unique.

In the Orders table, just save the customer ID field. To find the
address, use a query and link the two.


Now, there are times when you want to do what you are asking.
Selecting a shipping address is a good example, as it could be
different than the billing address, but you want to prepopulate it.
Here's how I've done it:


Create a combo box for the name of the individual. Add as many columns
as you need to reference fields. In the ColumnWidths property, set it
to 1";0;0;0; (show one column, don't show the next three).

Now, you can reference the second column by : ControlName.Column(1)

Let me know if you still have questions.


Chris Nebinger
 
G

Guest

This does help.

I am building a spare parts/inventory database that keeps track of what
parts, and how many we have. Since the part number is how I am going to fill
in parts used, I want to make sure I am filling in the correct #. By adding a
description of the part that automatically fills in, I will be able to tell
if I typed something in wrong or not.

I think I can use what you said, but will this show me the information I
want in the form I that I am filling information into?

Matt
 
C

chris.nebinger

Okay, that gives me enough to understand what you are doing.

Assume you have a Parts table, with fields PartID, PartName,
PartSupplier, etc.

Now you have a form for another table, but you need to put in the part
number. Create a combo box, name it cboPartID, for the RowSource build
a query showing partID and PartName. Make sure the column count is 2,
and column width is 1";0"

Now, on your form, add a text box, but don't link it to any field. It
will show [Unbound]. Type in = cboPartID.Column(1). Now, whenever you
change the combo box, the unbound field (it won't save anywhere) will
update.

Although, if you use a combo box, you could just show both columns
(ColumnWidth 1";1"). This would make it easier as well.


Chris Nebinger
 

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