Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Quicken Style Grid Question
Old
  (#1)
Bhom
Guest
 
Posts: n/a
Default Quicken Style Grid Question - 06-04-2007, 08:56 AM

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?


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Quicken Style Grid Question
Old
  (#2)
Mike and Jo
Guest
 
Posts: n/a
Default Re: Quicken Style Grid Question - 06-04-2007, 08:56 AM


"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?
>
>



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top