"Bhom" <EMAIL REMOVED> wrote in message
news

%JBb.9116$EMAIL REMOVED ink.net...
> 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.
I have done this using a MSFlexGrid and ComboBox. Store the IDs in the
ComboBox.ItemData(Index) property with the according text. In the
ComboBox_Click event send the ComboBox.ItemData(ComboBox.ListIndex) 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
> 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.
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.
>
> 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?
>
>