Scroll bar in a subform

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
 
J

Jack Leach

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)
 
J

Jack Leach

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top