Automatic fillin of fields

L

Leonard

I am wanting to choose an item in a single field and have
the other fields populated with the data associated with
this item from a table.

example:

Table
SKU#, Description, Price, Color

Form
I want to choose the SKU number and have the other fields
to "pop in"
 
J

Jim/Chris

Your table should only contain the SKU #. Storing the
additional data is unnecessary and bad programming. The
description, price and color should be stored in a
different table. On the form the additional fields can be
populated with the Dlookup function.

Jim
 
R

Rick Brandt

Jim/Chris said:
Your table should only contain the SKU #. Storing the
additional data is unnecessary and bad programming. The
description, price and color should be stored in a
different table. On the form the additional fields can be
populated with the Dlookup function.

I agree with this except for price. Since that can change it likely needs to be
stored with each record he is creating.
 
J

John

You need to have the form point to the table. Then you
can have each field in the form point to the appropriate
field in the table. This can be done in Record Source
under Data in the Properties screen of the form.

HTH,

John
 
M

mark

Assuming your SKU field is a dropdown based on a query,
you can do the following:

- Select the other fields (description, price, color) in
the query that also selects the SKU (you do not need to
display them in the SKU dropdown - you can manage that
within the properties of the dropdown field);
- In the AfterUpdate event for your SKU field, add code
similar to this:
Me.DescriptionFieldName.Value = Me!SKUFieldName.Column(1)
[Note: the column property is zero-based, so your first
column = 0]
Me.PriceFieldName.Value = Me!SKUFieldName.Column(2)
Me.ColorFieldName.Value = Me!SKUFieldName.Column(3)

Hope that helps!
 

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