Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


createing 2 or more tables


createing 2 or more tables

Author
Message
daveofgv
daveofgv
Forum God
Forum God (12K reputation)Forum God (12K reputation)Forum God (12K reputation)Forum God (12K reputation)Forum God (12K reputation)Forum God (12K reputation)Forum God (12K reputation)Forum God (12K reputation)Forum God (12K reputation)

Group: Forum Members
Posts: 77, Visits: 335
I might just be one of the few that just can't get it.......

If someone can explain it to me in a 2nd grade level (step by step) I would be very appreciative.....

I have 2 tables:

table 1: first_name, last_name, ssn, city

table 2: charge, chargecity, chargestate, chargeamount (which these are for charges when someone is arrested)

I can create one table and everything is just fine in my windows form (visual studio 2008 pro)

However, when I create 2 tables (like above) I can not get the "charges" to associate with the last_name. I have to add another entry which would cause duplicate records for one person.

Example: when a person goes to jail they get a charge (DWI). When the person goes to jail again they get another charge but I can't seem to find how to add it to the person already in my database.  If last_name is the primary key I don't understand how to add another charge and it show up under the persons name in my datagrid.

If I had one table everything would be fine, however, I would have to keep changing the charge instead of creating a "running total"

Am I not getting something here???

Hope this is simple to read

thanks

daveofv

Edited
4/23/2011 by daveofgv
toxiod
toxiod
Forum God
Forum God (7.9K reputation)Forum God (7.9K reputation)Forum God (7.9K reputation)Forum God (7.9K reputation)Forum God (7.9K reputation)Forum God (7.9K reputation)Forum God (7.9K reputation)Forum God (7.9K reputation)Forum God (7.9K reputation)

Group: Forum Members
Posts: 39, Visits: 225
hi daveofv,



you have to use an id or primary key that will reference to the second table id, you can do it by editing you recordset put some relationship between the 2 table. making the first table your mother and the second table is the child so that when you drag it your data into you form it will automatically create a relationship of you data and will save synchronously to your database.



to download a program sample that has a same function of that here's the link: http://forum.computerscienceguide.com/viewtopic.php?f=2&t=12



GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search