Solved

moving in DBGrid

Posted on 2002-03-06
1
161 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
JSON Response and request in VB6 application 11 805
MS Access Search and Replace Using VBA 6 92
Run code from text file in vb 1 87
Macro Excel - Multiple If conditions 2 87
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

749 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