Solved

moving in DBGrid

Posted on 2002-03-06
1
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

688 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