469,071 Members | 1,957 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,071 developers. It's quick & easy.

Help with the tables in VB 2005

hello everyone
i want a little help i made 2 table in the ms access (employee & evaluation) and i transfer it into the VB2005 and i set the primary key for both tables.


[PHP]Employee Table
----------------------------------------------------------
ID (PK) | Name | Salary
----------------------------------------------------------

Evaluation Table
----------------------------------------------------------
EmpID (FK) | Date (PK) | Comments
----------------------------------------------------------[/PHP]

when i start the program i enter the data of course i want to write more than one comments in one employee but when i write more than one data in the evaluation table the first data goes to the employee no1 and the other data goes to the employee no2 and so on.
but when i write the data i see EmpID show the ID of the employee i write on but after i do save it goes to the other Employee

[PHP]Employee Table:
----------------------------------------------------------
ID (PK) | Name | Salary
----------------------------------------------------------
1 | aaaa | $1000
2 | bbbb | $2500

Evaluation Table:
----------------------------------------------------------
EmpID (FK) | Date (FK) | Comments
----------------------------------------------------------
1 | 15/05/2007 | Good................First Data
1 | 16/05/2007 | Bad..................Second Data[/PHP]

the (First data & the second Data) should goes to the first Employee but the First Data Goes to the First Employee & Second Data goes to the second employee and if i write a third it goes to the third one.

so i don't know what's the problem & i wish to help me with this.....
Feb 23 '07 #1
1 952
willakawill
1,646 1GB
hello everyone
i want a little help i made 2 table in the ms access (employee & evaluation) and i transfer it into the VB2005 and i set the primary key for both tables.


[PHP]Employee Table
----------------------------------------------------------
ID (PK) | Name | Salary
----------------------------------------------------------

Evaluation Table
----------------------------------------------------------
EmpID (FK) | Date (PK) | Comments
----------------------------------------------------------[/PHP]

when i start the program i enter the data of course i want to write more than one comments in one employee but when i write more than one data in the evaluation table the first data goes to the employee no1 and the other data goes to the employee no2 and so on.
but when i write the data i see EmpID show the ID of the employee i write on but after i do save it goes to the other Employee

[PHP]Employee Table:
----------------------------------------------------------
ID (PK) | Name | Salary
----------------------------------------------------------
1 | aaaa | $1000
2 | bbbb | $2500

Evaluation Table:
----------------------------------------------------------
EmpID (FK) | Date (FK) | Comments
----------------------------------------------------------
1 | 15/05/2007 | Good................First Data
1 | 16/05/2007 | Bad..................Second Data[/PHP]

the (First data & the second Data) should goes to the first Employee but the First Data Goes to the First Employee & Second Data goes to the second employee and if i write a third it goes to the third one.

so i don't know what's the problem & i wish to help me with this.....
Interesting. You have Data as a primary key in the first example and a foreign key in the second example. As the word Date is a reserved word it is better to give this column a different name.

The example you have given shows the EmpID in your evaluation table to be correct in that it refers to employee number 1 in both cases.
Feb 23 '07 #2

Post your reply

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

Similar topics

1 post views Thread by prabhukalyan | last post: by
3 posts views Thread by Datatable Dataset Datagrid help | last post: by
7 posts views Thread by Richard | last post: by
1 post views Thread by uspensky | last post: by
11 posts views Thread by J.Evans.1970 | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.