insert and update based on user ...?
Im building a system for an employment application. The user/applicant will register for a login. (I am using the create double opt in registration tutorial to build the login portion)
1. I created a table to hold references. The columns I used are id(PK), user_id, name, phone, relation, how_long
2. I used DataAssist to create insert and update pages.
a. On the insert page setup I chose to leave out the id as it should be ok to auto increment on its own. I changed the user_id to a hidden field. The other fields I required but not relevant as my question pertains to the user_id and id.
b. On the update page I used both id and user_id to hidden (both fields are included on the page) and the other fields set same as the insert page.
3. The pages are created. Now I need to make sure the pages are looking for the correct values to attach the records to the correct user. I have stopped here to ask for guidance. I think I need to do the following but not sure if I am correct and dont want to have to start over.
a. On the insert page - Click the hidden field and replace the value with the binding "Sesson - SecurityAssist_UserID" - Im thinking this will set that value when the page loads to the sesson value held for the user. Am I correct?
b. On the update page I'd handle my user_id hiddden field the same way as above, but for the id field of the record that was inserted, wouldn't I create a new recordset called getRefID looking for all records in the reference table and filter the data WHERE user_id = "sesson UserID" AND id = url parameter id passed from the previous page (the users view page) and then set the value of my hidden id field to the result of the recordset id column.
This all seems right in my head but since dataassist creates code for me I dont want to remove any before i am sure that i am removing the correct stuff.
Would you do it this way or take another route?