PDA

Click to See Complete Forum and Search --> : Saving Databases with MS Flex Grid


Blasshole
Jun 26th, 1999, 11:36 AM
Lets say I create an Access 97 MDB file with the visual data manager, then I use the MSFLEXGRID to view it in a vb project. But once the mdb file is viewed and edited from within a vb project, what code do you use to save the changes made to the mdb with the MSFLEXGRID?

Blasshole
Jun 28th, 1999, 02:13 AM
Yeah you can edit the data through an MSFlexgrid......Just add the MSFlexGrid control to your form, put a data control in, put a felxgrid control in, set the data control's database name to the database you want, set the recordsource to the recordsource you want, then set the flexgrid's datasource to data1(or the name of the data control). From there, you can add rows by using the code:

dim rownumber as integer
rownumber = 1
msflexgrid1.additem rownumber

After that, to edit the contents of each individual cell, use the code:

msflexgrid1.row = 1
msflexgrid1.col = 1
msflexgrid1.text = "(put any text here)"

Thats what I have so far for my database. Now I gotta figure out how to save the database! I hope that helped. If it didnt, post another reply and ill see if I can still help you.

vikram.k
Jun 28th, 1999, 11:57 AM
Hi Bl*******,
I think MSFlexGrid displays read-only data, then how did you changed the data?, if it is possible will you suggest me how can we edit the data using MSFlexGrid control?