Solved

moving in DBGrid

Posted on 2002-03-06
1
159 Views
Last Modified: 2008-02-01
Hi VB Experts,

Again with DBGrid ...

please, i need the code which can do the following:
when I click "Enter" in the active cell , the pointer moves down (let the active cell becomes the next row in the same column) exactly like "MS EXCEL".  BUT when i reach the last Row , let the pointer moves till the first row in the same column.

Thank you so much
Toni2002
0
Comment
Question by:toni2002
1 Comment
 
LVL 32

Accepted Solution

by:
bhess1 earned 50 total points
ID: 6845465
In the DBGrid_Keypress event:

If KeyAscii = 13 Then  ' Enter
   KeyAscii = 0
   On Error Goto AtBottom
   DBGrid.Row = DBGrid.Row + 1
   On Error Goto 0
End If

ExitKeypress:
Exit Sub

AtBottom:
DBGrid.Row = 0
DBGrid.FirstRow = 0
Resume ExitKeypress

End Sub
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question