Quicken Style Grid Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bhom

    Quicken Style Grid Question

    I am trying to create a grid on a form that looks like the 'Split
    Transaction' grid in Quicken - it allows drop down controls in various cells
    of grid to make a selection, and then stores the text of the drop down
    list/combo boxes in the grid.

    I know how to use hidden combo/list boxes that display when a user clicks on
    a cell that is setup with the drop down button and event. However, when the
    user makes a selection, the ID (bound field) related to the selection is
    stored in the grid cell instead of the text. And if I try to save the text
    value, I get a database error when trying to save the grid information to
    the database. I have tried using a data control and using a separate
    recordset to populate the grid. I would also like to be able to roll back
    the information in the grid if the user clicks a Cancel button to abandon
    changes.

    This is such a common requirement that I can't believe the DataGrid,
    HFlexGrid, or FlexGrid can't do this. I'm using VB6 enterprise edition and
    a MS Access database.

    Any ideas?


  • Mike and Jo

    #2
    Re: Quicken Style Grid Question


    "Bhom" <williedillo@ea rthlink.net> wrote in message
    news:p%JBb.9116 $rP6.7315@newsr ead2.news.pas.e arthlink.net...[color=blue]
    > I am trying to create a grid on a form that looks like the 'Split
    > Transaction' grid in Quicken - it allows drop down controls in various[/color]
    cells[color=blue]
    > of grid to make a selection, and then stores the text of the drop down
    > list/combo boxes in the grid.
    >
    > I know how to use hidden combo/list boxes that display when a user clicks[/color]
    on[color=blue]
    > a cell that is setup with the drop down button and event. However, when[/color]
    the[color=blue]
    > user makes a selection, the ID (bound field) related to the selection is
    > stored in the grid cell instead of the text.[/color]

    I have done this using a MSFlexGrid and ComboBox. Store the IDs in the
    ComboBox.ItemDa ta(Index) property with the according text. In the
    ComboBox_Click event send the ComboBox.ItemDa ta(ComboBox.Lis tIndex) into the
    current grid cell. If you're not sure how to set the ComboBox ItemData here
    is an example:

    Query the Text and IDs into a recordset and do the following:

    With mRecordset
    .MoveFirst
    Do While Not .EOF
    Combo.AddItem !Text
    Combo.ItemData( Combo.NewIndex) = !ID
    .MoveNext
    Loop
    End With

    And if I try to save the text[color=blue]
    > value, I get a database error when trying to save the grid information to
    > the database. I have tried using a data control and using a separate
    > recordset to populate the grid. I would also like to be able to roll back
    > the information in the grid if the user clicks a Cancel button to abandon
    > changes.[/color]

    There are RollBack functions for Databases. I'm not too sure on how well
    they work. I was under the impression that you can use RollBack prior to an
    Update call to the Recordset.
    [color=blue]
    >
    > This is such a common requirement that I can't believe the DataGrid,
    > HFlexGrid, or FlexGrid can't do this. I'm using VB6 enterprise edition[/color]
    and[color=blue]
    > a MS Access database.
    >
    > Any ideas?
    >
    >[/color]


    Comment

    Working...