Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

moving in DBGrid

Posted on 2002-03-06
1
Medium Priority
?
167 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:
Brendt Hess earned 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 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