Getting Rid of Horizontal Scroll Bar in Datasheet View

  • Thread starter Thread starter Chaplain Doug
  • Start date Start date
C

Chaplain Doug

Access 2002. I have a form that displays in datasheet
view. I set the form's properties to vertical scroll bar
only, but both vertical and horizontal bars appear. How
may I change this?
 
Can't do in datasheet view. You'll need to use continuous forms view and
make the controls look like datasheet "view".
 
Thanks Ken. But in continuous form view the arrow keys
don't act like they do in datasheet view (down arrow does
to same field of next record, etc.). I posted this
problem, but the solution given acts like a tab from field
to field rather than from record to record. How can I
make the arrow keys act in continuous form view like they
do in datasheet view? Thanks.
 
Hmmm... haven't tried this, but I would imagine that you could trap the
KeyDown event, test if it's the up or down arrow, and depending on which it
might be, run code to discard the key value, identify the control that
you're in, move to the next/previous record, and set focus to that same
control.
 
Borrowing from Rick B's posted code, you might modify it this way:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim strControl As String
On Error GoTo ErrHandler
Select Case KeyCode
Case vbKeyDown
KeyCode = 0
strControl = Screen.ActiveControl.Name
DoCmd.GoToRecord Record:=acNext
Me.Controls(strControl).SetFocus
Case vbKeyUp
KeyCode = 0

strControl = Screen.ActiveControl.Name
DoCmd.GoToRecord Record:=acPrevious
Me.Controls(strControl).SetFocus Case Else
' Do nothing
End Select

Egress:
Exit Sub

ErrHandler:
If Err.Number = 2105 Then
KeyCode = 0
DoCmd.Beep
Else
MsgBox Err.Description
End If
Resume Egress
End Sub
 
Back
Top