Hi everybody,

I've got a problem with vb programming. My program use ADO data control and Datagrid. I make a master-detail form, and I connect them with ADO data control and Datagrid. For detail table, I use a datagrid. But it seems that I've got a trouble when I add a new record.
First problem is Every time i add new record, I want that new record to be added at my master file and also at my detail file.
Everytime, I have type for the first row in the grid, and i want to move my cursor using down arrow to the second row, an error message occured :

IRowsOffset would position you past either end of the row set, regardless of the cRows value spesified, cRows obtained is 0

Could you tell me how to handle this kind of error.???

Second problem is
in my program, i have an undo facility, which function is to cancel all things that already typed in the textbox or in the grid.
In Undo event, I used a statement :
datagrid.datachange=false
and there is also an update facility to change the data. In the update event, i used a statement below :
datagrid.allowaddnew=true
datagrid.allowupdate=true
datagrid.allowdelete=true

After I change or add, or delete a couple of rows in the datagrid, and I click undo again, the data which not change only in the last row of the grid.

BRgds,
Sugioto