Results 1 to 6 of 6

Thread: Flexgrid

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Posts
    1,384

    Flexgrid

    I need code that will delete the line highlighted by a user in a MSFlexGrid.

    I've tried :

    MSFlexGrid1.removeItem

    But the program is looking for an index number.
    Mel

  2. #2
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    VB Code:
    1. With myGrid
    2. If (.Row = .RowSel) Then
    3.      .RemoveItem (.Row)
    4. Else
    5.       MsgBox "You can only remove one record at a time!", _
    6.                    vbInformation, _
    7.                    "Delete"
    8. End If
    9. End With

    This allows 1 row to be deleted

  3. #3
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Guess my code didn't work.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Posts
    1,384
    Yes the code works ... in the sence that the row is removed from the Grid, but doesn't delete it from the database.

    How do I delete it from the data source aswell???
    Mel

  5. #5
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Choice 1 : In code using ADO where you got the data from in the first place.
    Choice 2 : Bind the grid to the data. (bad idea)

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Posts
    1,384
    How do I do this?

    Choice 1 : In code using ADO where you got the data from in the first place.
    Mel

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