473,396 Members | 1,702 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,396 software developers and data experts.

Updating a Table Using Query

manoj9849967222
HI All

I have two tables One is "master" & the other one is "child".

The master Table have filds

Productcode -----Number
Productname-------Text

Child Table

Productcode-----Number
Productname--------Text
Amount--------------Currency

Now i have designed a form using Query. When ever i enter Productcode it gives me the productname automatically. I also have a add button in the form.

Every thing is working. But the problem is when i click add button. only the Productcode gets added to the child table Productname is not added.

Please help.

Regards
Manoj
Aug 8 '07 #1
3 1849
JKing
1,206 Expert 1GB
If the productname is being stored in the master table is it really necessary to store it in the child table? If the tables are joined which they seem to be by the productcode then you can retrieve the productname from the master table based upon the productcode in the child table.
Aug 8 '07 #2
If the productname is being stored in the master table is it really necessary to store it in the child table? If the tables are joined which they seem to be by the productcode then you can retrieve the productname from the master table based upon the productcode in the child table.

Hi JKing

I think you didnot get me.

I have two Tables

1. Product
with fiels Productcode---Number
Productname--Text

Now i want to design a form where i enter the Productcode & the Productname gets populated automatically.This i have done using a Query. when ever i enter the productcode the product name gets populated automatically.

Now i want this data to store in another table. that is the reason i have created another table called "Detail".
With fiels Date------ date/time
Partyname ---Text
Productcode---Number
Productname --- Text
Amount-----------Currency

I have created a form with the above fiels & a command button.

after entering the above fiels. I enter the productcode & the productname gets populated automatically.

Problem comes when i click the command button to add those records to the Table "Detail". Every things get added except the Productname.

Hope you understand me better this time.

Please Help

Regards
Manoj
Aug 8 '07 #3
JKing
1,206 Expert 1GB
I understand the problem.... productName isn't being stored in the "Details" table. What I am suggesting is that you rethink your table design. If you have the productName stored in table "Product" then you wouldn't needed to store it in your table "Details". Since the tables are related through productCode you can always retrieve the productName from the table "Product".

Have a look at this article on Table Structure and Normalization. Particularly 2NF.

Normalization
Aug 8 '07 #4

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

Similar topics

3
by: | last post by:
Hello, Sorry to ask what is probably a simple answer, but I am having problems updating a table/database from a PHP/ PHTML file. I can Read From the Table, I can Insert into Table/Database, But...
11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
1
by: Old Timer | last post by:
I wish to type in a number in my "Code" field, for instance 1060, I then wish the number 1060 to trigger an event that will fill in the next field (township field) For instance, 1060 brings up and...
1
by: Derek Davlut | last post by:
I have a Table that contains data that I use in a query to manipulte the data through expressions. I have a form that uses the query for manipulating the data. How do I write the changed values...
3
by: Steve Housechild | last post by:
I have a table of 'Customers', a table of 'Newsletters' and a table for storing which customers have recieved which letters 'CustLett'. By using a query, I have pulled a list of customers who...
1
by: Chris Jackson | last post by:
I'm a novice Access user and am not sure how to solve the following problem. Any help with the following would be greatly appreciated! I have two tables with identical structures, the first holds...
2
by: Ray Holtz | last post by:
I have a form that shows a single record based on a query criteria. When I click a button it is set to use an append query to copy that record to a separate table, then deletes the record from the...
3
by: Jon Agiato | last post by:
Hi, I am trying to use a data grid in a web application in which I have three tiers. The DataGrid is not set up to a data source, or a data adapter, so everytime I make a change I send the cell...
33
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range...
6
by: OldBirdman | last post by:
I don't really know how to state this problem, as it doesn't make any sense to me. I have a simple "One-to-Many" query, and was updating the Many side. It quit working. I cannot make any changes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.