Scroll bar in a subform

  • Thread starter Thread starter Jess
  • Start date Start date
J

Jess

I have continuous subform within a form. The subform has a vertical
scrollbar. When I enter a new record the focus is moved to the first record.
Whenever no new records fit into the subform window, I have to scroll all the
way down to keep entering new records. Is there a way to have access set the
focus to the new record? I do not wish my users to be scrolling down the
subform every time they want to enter a new record? Can anybody list a
workaround for this? Thanks
 
You can use the following command:

DoCmd.GoToRecord, , acNewRec

You may need to include the first two arguments if you want this to run from
your parent form (say from a button).

hth

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
You may need to include the first two arguments if you want this to run from
your parent form (say from a button).

Sorry, I think may not be quite right. You won't be able to pass the name
of the subform to this because its not technically an "open" form.

One apparent workaround is to set the focus to the subform control first:

Me.SubformControl.SetFocus
DoCmd.GotoRecord, , acNewRec


If that doesn't work you may need to use a sub thats public from your
Subform...

(in the subform code)
Public Sub GoToNewRec()
DoCmd.GotoRecord, , acNewRec
End Sub

(from the main form)
Me.SubformControl.Form.GoToNewRec


hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Back
Top