Another strange behavior with DBGRID !!!

Another strange behavior with DBGRID !!!

Post by Peter Stoffe » Thu, 14 Jan 1999 04:00:00

Hey again !!!

Well  now I found another problem using the dbgrid databound to a
datacontrol (using vb5-SP3 and ms Access).

When a user wants to put data into the grid, they can put a '?' and get a
choosebox from which they can choose the data available for the field....
but after returning the choosen data to the column in the dbgrid different
things happens;

1: A good return is made, which means that the field in the grid is filled
and marked(highlighted) then the user can push return and go on to the next
field and so on. Thats how I would like it to work....

2: A good return is made, but the field is not higlighted and there is no
cursor in the grid anymore.... then you have to move your mouse to the grid
and click it, and then you can make your next input. Thats really not they
way I would like my users to work...... they'll get damaged :-) by this

Here are the code i use to test the input fields, show and return the

Private Sub grddatagrid_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

If grddatagrid.Columns(1) = "?" Then

    frmvalgarbejdsart.Show vbModal  '-- Show the chooseform
    grddatagrid.Columns(1) = frmvalgarbejdsart.ArtNr '-- put the choosen
field into the dbgrid
    Unload frmvalgarbejdsart '-- Unload the chooseform
    grddatagrid.col = 1    '-- try to force to stay in column 1

End If
And so on for the rest if the columns......

End If

End Sub

Well i cant find the explanation, and I have tried a lot......... does
anyone know about this problem/bug in the dbgrid-control, or is there
another method to highligt the field in a column.


Peter Stoffer


1. Strange behavior with DBGRID

Hey !!!!

If anyone can help. plzzzzz..........................

My problem is as follows(using vb5 and access db):

Ex. 1

If I use the formwizard to create a form with textfields and I manually add
a grdcontrol bound to the same datacontrol as the textfields, to show the
whole contens of the table is it possible to put your mousepointer on any
row in the grid and hit delete, then you can hit the delete button again and
the next record flies away.... hmmm.. thats realy what I want to be able to,
but now the problem comes.....

Ex. 2

If I create a form, againg with the form wizard, and make it to a
dbgrid-form (same db and table), then i can't use this delete method (the
function is the same !!!). That means I have to pick the record to delete
every time I want to delete somthing...... It is just like the grd-control
doesn't accept the movenext commando....... after deleting in the grid the
pointer disappears from the grid, but in the first example it moves nicely
on to next record......

Anyone with a answer to that !!!! and how to be able to hit delete more than
one time, and the it deletes the next record......

Thanx in advange.....

Peter Stoffer

2. bcp work with dbf tables?

3. D2/DBGrids: strange behavior (blank posts)

4. I found it, I FOUND IT!!

5. Strange DBGrid behavior?

6. How do I insert a carriage return into a table

7. Strange behavior on multiple primary key behavior deleting childr

8. Snr Oracle DBA contractor seeking work in Melbourne, Aus

9. Strange behavior on multiple primary key behavior

10. Strange behavior on multiple primary key behavior d

11. Not sure where to put this--strange ODBC behavior (or I think it's strange)

12. Strange Behavior with Transformation Properties

13. Strange Behavior