473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Auto Fill

I have am mdb file and have two tables in it.
One called “Drugs” and the other called “Inventory”
In the “Drugs” table, I have two columns called:
“Drug ID” and “Drug Name”
In the “Inventory” table, I have four columns called:
“Drug Code”,” Drug Name”, “Manufactured Date” & “Expiration Date”.
The Drug Code and Drug Name in “inventory” table are looking up from “Drug ID” and “Drug Name” in "Drug” table. When I type or click the Drug Code in “Inventory” table, I want the Drug Name that was assign to that id in “Drug” table to automatically fill itself into the drug name in the inventory.
What should I do?
Nov 6 '08 #1
1 932
Stewart Ross
2,545 Expert Mod 2GB
The short answer is that under no circumstances should you be including the drug name in the inventory table. To do so is to invite update anomalies; if at some stage the drug name in the inventory table differs from the drug name in the drug table, how would you know which one was correct?

If your table structures were correctly normalised you would understand that the drug name does not belong to the inventory table. In third-normal form the fields in a table must depend solely on the value of the primary key, and the value of the drug name clearly does not depend on the primary key value of the inventory table.

You may find our HowTo article on database normalisation and table structures helps with the concepts involved.

To get the drug name for an inventory report, say, you simply use a query to join the inventory table to the drug table on the drug ID field, then include the drug name from the drug table in the query alongside the inventory details.

-Stewart
Nov 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Sims | last post by:
Hi, I have a table that give a unique ID to certain Articles. To give the ID i simply use the Auto count of the DB. But what happens when i delete a record? i am now missing an ID. How can i...
1
by: Maurice Mertens | last post by:
Does anyone know how to get an auto-filling combobox on a form? When I add a combobox to a form I can set the DropDownStyle property to DropDownList. This will make the combobox auto-filling. But...
3
by: Maurice Mertens | last post by:
Hi all, In VB.NET you can set the DropDownStyle for a combobox to 'DropDown' or 'DropDownList'. When you set it to DropDownList, it supports auto-fill. But when you set it to 'DropDown', the...
1
by: Benny | last post by:
Hello experts, Currently I am working on a web application using vs.net with c#. One of the project task is creating invoices. After the invoices are created, the user needs login to a...
1
by: qwas2123 | last post by:
Hi, Im trying to build a form that within the form it has a feature that if you input data into a certain text box, from there, it will automatically fill the rest of the text boxes on the form based...
2
by: Elainie | last post by:
I have been trying to auto fill fields with DLookup - but it doesn't seem to work..... can you help... I have a name field and I want the address to automatically fill in when the name field...
0
by: KelHemp | last post by:
Greetings, I've been using this site for lots of access help in the past, and it's very helpful! I have a new complexity for you all. Reworking a form to record 70-80 years of oil production on...
0
by: Boki | last post by:
Hi All, I am creating a program that performs "auto fill in" and "auto submit" functions. I will feed the webbrowser the target URL, however, I don't know how to auto fill in text and submit....
3
by: Steve67 | last post by:
I didn't see a search feature in these forums, so I couldn't look up this question and I am sure it is a common questions. I am trying to auto fill some information on an form. Here is what I have...
10
by: Charles Richmond | last post by:
Is there some parameter I can set via Javascript that will cause the browser to *not* auto-fill forms, regardless of the browser settings??? --...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.