Form1 : Listview with Add, Modify and Delete command
Form2 : text boxes and combo boxes to filled or modify selected data with save (for Add), update (for modify) button.
1) Load Form 1 on start up and click add button:-
load form2
form2.show
db.Execute ("Insert into deductor (Code,TDScircle,Name,PAN,TAN,TCS,Flat,Premises,Road,Area,Town,State,Pin,Mobile,STD,Telephone,Fax,Status,Ptype,Email,Rstatus) values('" + Text1.Text + "','" + Text2.Text + "','" + Text3.Text + "','" + Text4.Text + "','" + Text5.Text + "','" + Text6.Text + "','" + Text7.Text + "','" + Text8.Text + "','" + Text9.Text + "','" + Text10.Text + "','" + Text11.Text + "','" + Combo1.Text + "'," + Text12.Text + " ," + Text13.Text + "," + Text14.Text + "," + Text15.Text + "," + Text16.Text + ",'" + Combo2.Text + "','" + Combo3.Text + "','" + Text16.Text + "','" + Combo4.Text + "' )")
Form1.ListView1.Refresh
Load Form1
Form1.Show
i am able to add the data into database but not able to display the data into listview at run time. For this purpose i have to close the program and then start.
plz tell me how to show the data into listview at run time with closing the program.
2) Not know the code for modify the data though i can edit the selected data in form 2.
Load Form2 Form2.Show Form2.Text1.Text = ListView1.SelectedItem.Text Form2.Text2.Text = ListView1.SelectedItem.SubItems(1) Form2.Text3.Text = ListView1.SelectedItem.SubItems(2) Form2.Text4.Text = ListView1.SelectedItem.SubItems(3) Form2.Text5.Text = ListView1.SelectedItem.SubItems(4) Form2.Text6.Text = ListView1.SelectedItem.SubItems(5) Form2.Text7.Text = ListView1.SelectedItem.SubItems(6) Form2.Text8.Text = ListView1.SelectedItem.SubItems(7) Form2.Text9.Text = ListView1.SelectedItem.SubItems(8) Form2.Text10.Text = ListView1.SelectedItem.SubItems(9) Form2.Text11.Text = ListView1.SelectedItem.SubItems(10) Form2.Combo1.Text = ListView1.SelectedItem.SubItems(11) Form2.Text12.Text = ListView1.SelectedItem.SubItems(12) Form2.Text13.Text = ListView1.SelectedItem.SubItems(13) Form2.Text14.Text = ListView1.SelectedItem.SubItems(14) Form2.Text15.Text = ListView1.SelectedItem.SubItems(15) Form2.Text16.Text = ListView1.SelectedItem.SubItems(16) Form2.Combo2.Text = ListView1.SelectedItem.SubItems(17) Form2.Text17.Text = ListView1.SelectedItem.SubItems(18) Form2.Combo3.Text = ListView1.SelectedItem.SubItems(19) Form2.Combo4.Text = ListView1.SelectedItem.SubItems(20) If ListView1.SelectedItem Is Nothing Then MsgBox "No Deductor selected to update.", _ vbExclamation, _ "Update" Exit Sub End If
but unable to update the data. Required code for this.
3) I can delete the data selected in listview but not at run time.
plz provide me proper code for it.
This post has been edited by JackOfAllTrades: 03 March 2010 - 08:24 PM
Reason for edit:: Added code tags. PLEASE!!! [code]...PUT YOUR CODE IN HERE!!!...[/code]

New Topic/Question
Reply




MultiQuote



|