Scrolling through records on subform with Page Up/Down keys

D

David Anderson

I have a form that will scroll through its records when I use the Page
Up/Down keys or scroll the mousewheel (no coding needed). So far, so good.
When I embedded this form as a subform in another form and have focus on the
subform I was hoping for the same behaviour. However, only the mousewheel
will scroll the records in this situation. The Page Up/Down keys have no
effect. Is there any way to make the Page Up/Down keys work for my subform?

David
 
A

Arvin Meyer [MVP]

Testing in both Access 97 and 2002, the Page Up/Down keys work for scrolling
a page at a time, and the Arrow Up/Down keys work a record at a time. This
is the case with either a main form or a subform, as tested using a
datasheet view.
 
D

David Anderson

Hi Arvin,
Rather stupidly, I forgot to say which version of Access I was using. As it
happens, I'm using Access 2000 - the one you didn't test! However, it would
be surprising (though not impossible) for Access 2000 to do things
differently from both its predecessor and its successor.

My application uses form view only for the subform, but I experimented with
datasheet view. This time neither the Page Up/Down keys nor the mousewheel
would scroll the subform records!

As my results are so different from your tests, it suggests that there is
something about my mainform design that is inhibiting the normal scrolling
behaviour in the subform. I will try to create a simple test design in an
attempt to emulate your test results. If that works, then I could start
changing it to be more like my real forms - until it stops working. That
process might highlight the source of my problem.

David
 
D

David Anderson

I have now found out that my test in datasheet view will react to the
mousewheel if not all the records can display at the same time (my previous
test showed all the datasheet records on the subform). However, the
mousewheel does not step from record to record. It scrolls the entire page.

Using single form view for my subform as my application requires, I have now
been able to get the Page Up/Down keys to scroll the subform records - but
only (so far) by placing the focus on an enabled text box within the subform.
The Page Up/Down keys don't scroll if the focus is on an option group. This
makes no obvious sense to me.

If the subform is run independently of the main form, then it doesn't seem
to matter what control has the focus. The Page Up/Down keys will always
scroll the form records.

Can anyone explain what's going on here?

David
 
A

Arvin Meyer [MVP]

Usually, once focus is inside a subform, option group, listbox, or dropped
down combo box, it will scroll within the control (not between records). My
mouse is an older Microsoft wireless optical mouse.
 
D

David Anderson

I can't comment on what is usual, as I've never considered this problem
before, but in my case there is no doubt that the Page Up/Down keys scroll
the records when the subform is run on its own in single form mode. It does
not scroll the option group buttons within a single record (there are no
listboxes or combo boxes).

I remain rather puzzled by this topic...

Since my mousewheel is already doing what I want, the make of mouse is not
really an issue.

David
 
D

David Anderson

I've now resolved my problem, by using the subform KeyDown event to run code
that moves back and forwards through the form's recordset in reaction to the
Page Up/Down keys.

I would still be very interested to know why such coding is required when
the form is used as a subform but not when the form is opened directly.

David
 

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