Data Entry Becomes User Friendly: Move To The Next Cell In DBGrid Std Control

Data Entry Becomes User Friendly: Move To The Next Cell In DBGrid Std Control

When I replaced the Apex dbGrid, with the free upgrade, TDBGridS1.OCX,I got complaints about the behavior of the grids when I enteredor edited data in TDBGrid Standard. The cell pointer stays putand highlights the text just entered. The user must press theenter key a second time or use the arrow key to move to the nextcell.

Three lines of code automatically move the cursor to the nextcell after entering or editing a cell. The grid is in the Boundmode.

1. Create a form level variable:

         Dim KC as integer

2. In the TDBGridS1_Keydown Event:

 Private Sub TDBGridS1_KeyDown(KeyCode _        As Integer, Shift As Integer)        KC = KeyCode    ' Trap the keycodeEnd Sub

3. In the TDBGridS1_AfterColEdit Event:

 Private Sub _        TDBGridS1_AfterColEdit(ByVal _                ColIndex As Integer)        ' statments go here        ' on the last line use this code:        If KC = 13 Then SendKeys "{Enter}"End Sub
Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved