3 Replies - 1246 Views - Last Post: 04 March 2010 - 03:24 AM Rate Topic: -----

#1 vishaldalya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 31-January 09

listview development

Posted 03 March 2010 - 12:35 PM

I am developing small application using listview control and database created in MS access.

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]


Is This A Good Question/Topic? 0
  • +

Replies To: listview development

#2 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: listview development

Posted 03 March 2010 - 07:07 PM

good but you need to name the textboxes for resonably and you should write the code in form2
Was This Post Helpful? 0
  • +
  • -

#3 Kinwang2009  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 76
  • Joined: 07-February 10

Re: listview development

Posted 03 March 2010 - 08:53 PM

Hi Vishal,

I will try to mail you and attached example of ListView since here we cannot upload/attached sample codes.

thankx
Was This Post Helpful? 0
  • +
  • -

#4 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: listview development

Posted 04 March 2010 - 03:24 AM

no you can upload your project with attach files provided in the reply section
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1