# update to datagrid vb6



## Guest (Sep 24, 2002)

I'm having one of those vb weeks im afraid
got a screen in which a user enters data into several textboxes
at a click of a button this data updates a temp table in access
but i also want this data to be displayed on a datagrid on same page as soon as the button is clicked
it is updating table no problem, but the datagrid is not showing the latest row to be added
it is one record behind each time
no matter what refresh commands etc that i run i can only get it to show the records minus last record added
i always use adodc code for my data apps,
Do i need some kind of loop that checks for all of the records in that table then returns it?
Or is there a simple function?
again its probably something daft i have missed, but can someone help
thanks


----------



## TimCottee (Oct 10, 2001)

What cursor type are you using? The default CursorType property for the ADO data control is adOpenStatic, this takes a snapshot of the data at the time the recordset is opened, it doesn't necessarily allow for additional records to show. You could try either changing the CursorType to Keyset or Dynamic or alternatively try using the .Requery method of the recordset to effectively re-issue the original query statement to the database and thus obtain any new matching records that otherwise would not be shown.


----------



## Guest (Sep 24, 2002)

i didnt think about the cursortype
i did have the requery method in there somewhere, i have moved it as it further down the code and changed the cursortype and it now works
cheers again tim


----------

