Results 1 to 3 of 3

Thread: WARNING: Newbie question.

  1. #1

    Thread Starter
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692

    WARNING: Newbie question.

    This should be an easy one; it involves editing records.

    Here's the situation:

    I am displaying the contents of a database inside a listview. I am wanting to edit the listview, and when I finish, it will first search the database for the old value (held in a String-type variable called OldVal), and then update it with the new value (what I put in the listview.)

    One more thing: I'm not using a bound control, so a simple rs.Update is out of the question.

  2. #2
    Lively Member
    Join Date
    Jun 2003
    Location
    South Africa
    Posts
    123
    I dont think you can edit the values in the listview itself.
    This is what I do...
    Populate the listview and with the records
    including the Primary Key (either as item key or listview text)
    when u double click the Listview execute a similar Query
    "SELECT (fields) FROM (table) WHERE (primary key) = " & listview.selectedItem.Text
    All you have to do is populate textboxes with the Recordset.

    Do While Not RS.EOF
    text1.text= RS!FieldName
    loop

    It helps setting the Listview labelEdit property to manual and FullRowSelect to true.

    Hope this helps,
    If you find a way to edit in listview please let me know
    Beware of the Dog

  3. #3

    Thread Starter
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692
    VB Code:
    1. ListView1.StartLabelEdit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width