• lonhanner (12/18/2012)


    I have two tables (TRIP and TRIP_DETAIL both have the same primary key called TRIP. There is no FK relationship. I have data in both tables. I need to create a Master/Detail form in VB.NET Pro 2010.

    I need to add a new column in the TRIP_DETAIL table called TD_NUM. Then sort the table by TRIP column, and Then fill the new column TD_NUM with int value in ssequencestarting at 1. Then after filling the TD_NUM column make it the primary key and make the TRIP column a FK. I am very new at sql could someone give me an example on how to do this . I know how to add columns. I just need the sql query to do the sort and fill the New TD_NUM.

    There's no FK relationship? Make one! It's a Master/Detail form... that's what FKs are for!!!

    You need to add the column for the foreign key... I'll give you a hint, because I'm not doing your homework. Look up ALTER TABLE... adding columns and foreign keys are in there. Read Books Online. Hiding under the F1 key.