Auto filling fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a problem which I need some help with, as I am not very
experenced with Access. Here it is :- I have 2 tables -1. Part information
with fields containing part number, description, amount of stock held, cost
of part , size of part. 2. Part ordering with fields part number, quantity
of part ordered,total cost of part, date ordered, planned delivery. The help
I need is when I enter the part number ( which is the primary key in both
tables) I want the other fields to automaticlly enter the relevent data in
the other fields, ie description and amount of stock held & total cost of
part. Any one with any idea's ?
 
A. If you make the Part Number the primary key in your Part Ordering table,
you'll only ever be able to enter one order for each Part Number. Is that
what you have in mind?

B. If you change your table design so that you can have more than one order
for one part number, will that part number always have the same description
in the Part Ordering table? Or do you want to be able to change that
description for each order? If the former, you shouldn't have a description
field in the Part Ordering table at all - just pull it (with a query, for
example) when you need it.
 
Hi,
Thanks for the post MacDermott.
I set the part number as the Primary key to link the Part information table
with the part ordering table. I will only be ordering each part once a day
but may need to order the same part the next day, will this be possible if I
keep the part number as the primary key.
The part number is unique and the description is always the same (
should have called it part specification), I want to type in the part number
in the part order form and it auto fill in the part description (
specification) fields so I can check it is the right part I am ordering, hope
you can follow that. cheers for your help.
 
Sounds as if you might could use a refresher on relational databases.
Part Number should be the Primary Key of the Part Information table, but not
of the Part Ordering table, where it functions as the foreign key.
One approach would be to make a form based on the Part Ordering table. Make
a combobox based on the Part Information table, using the two fields
PartNumber and PartDescription. Set its ControlSource to the PartNumber
field in your Part Ordering table. I'll call the combobox cboPartNumber.
Add a textbox, and set its ControlSource like this:
=cboPartNumber.Column(1)
Now when you select a Part Number in the combobox, the description should
show up in your textbox.

HTH
 
Back
Top