dataset-Insert/update multiples tables from one form entry - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

dataset-Insert/update multiples tables from one form entry

Help Me, Please..VERY URGENT

I have this cenario:

A form that will collect informations from a NewcomplaintForm.vb for complaint_table(ID as pk_key, complaintid, complainttype, date, desc, status, recommendation, etc..); complainant_table(Complainantid, last, first, etc..); offender_table(offenderid, last, first, etc..) dutyofficer_table(dutyofficerid, last, first, etc..) and insert data into these tables respectively.

when new complaint, check for complaint last and first name and identication, if exits, update/modify and create a new complaint document. if not exits, create new complaint doc.





Modify table structures:

Complaint-table
1)ID (Primary KEY)
2)ComplaintID (ComplaintID Should be autoincremented when new complaint, formatted as"00001" and attach current date to it)
3)ComplainantID
4)OffenderID
5)DutyOfficerID
6)ComplaintType
7)ComplaintDesc
8)Status
9)Recommendation
10)DateFiled

Note: The reason to format ComplaintID as (00001) is because I want to the current date to attach to it so it can become COMPLAINTID=00001022509 AS the compalintid. the first five 5 digits reset on NEW YEAR. How to do that


Complainant-Table
1)ID (Primary KEY)
2)LASTNAME
3)FIRSTNAME
4)ETC..

Offender-Table
1)ID (Primary KEY)
2)LASTNAME
3)FIRSTNAME
4)ETC..

DutyOfficer
1)ID (Primary KEY)
2)LASTNAME
3)FIRSTNAME
4)ETC..

And sql express, one can set pk_key as one of the option but not fp_key.. don't know how to set fk _key on a specific colunm yet on Sql Express

Once I set up the tables with their relationships, I can now have a dataset on them and drag them as details on the form. Mind you not all the columns and IDs I would want on the form and the form.
What to do on that?
And how can I insert/update/delete?



I need to accomplish the following:

1) CREATE A NEW COMPLAINT AND PRINT IT
2) SEARCH FOR A COMPLAINT BASED ON COMPLAINTID OR COMPLAINANTID, OFFENDERID


Please give me step by steps to get this done..
I am very new in this..

Sign In or Register to comment.