Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using the cursor to move down a row in a form 1

Status
Not open for further replies.

Tessadear

Technical User
Mar 7, 2006
26
BB
In a database table I can use the cursor to move down from row to row in column lets say to enter amounts but in the form I find I can only move from one field to the other horizontally with the tab which is fine. But I also want to be able to move down a column in the form using the cursor key just like I would in the database table.

Any ideas
 
if your form is datasheet view you should be able to move it up and down in a different format you wont be able



I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
How are ya Tessadear . . .

Open the form in design view then:
[ol][li]In the [blue]detail section[/blue] put a question mark ([purple]?[/purple]) in the [blue]Tag[/blue] property of all the controls.[/li]
[li]Set the forms [blue]Key Preview[/blue] property to [purple]Yes[/purple].[/li]
[li]In the [blue]KeyDown[/blue] event of the form, copy/paste the following:
Code:
[blue]   If Screen.ActiveControl.Tag = "?" And Me.Recordset.RecordCount > 1 Then
      If KeyCode = 38 And Me.CurrentRecord <> 1 Then
         Me.Recordset.MovePrevious
      ElseIf KeyCode = 40 And Me.CurrentRecord <> Me.Recordset.RecordCount Then
         Me.Recordset.MoveNext
      End If
   End If[/blue]
[/li][/ol]
[blue]Your thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Works like a dream Aceman. Thanks a million
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top