Subform keeps popping to first record

J

Jerry Porter

In a subform in an Access 2000 mdb, whenever I click on a record, it
always moves the focus back to the first record in the subform.

I tried creating the subform from scratch with default settings and no
code. It was fine when the subform data was not linked to the main
form, but when I added the Link Child and Link Master fields, the
problem occurred.

The main form is an unbound form, and the Link Master Field in the
subform is from a listbox on the main form. Perhaps I need to filter
the subform in code, instead of using Link Child/Link Master?

Jerry
 
S

strive4peace

Hi Jerry,

it sounds like you are using Requery on the subform -- this sets the
record pointer back to the first one


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
J

Jerry Porter

Thanks, Crystal, but there is no (explicit) requery in the subform. No
code or macros at all. I started over with an empty form and a few
fields and got the problem when I added the linking properties. I'm
thinking it has to do with the fact that the linked field on the main
form is unbound.
 
S

strive4peace

Hi Jerry,

if you are not changing the listbox, I cannot see any reason that the
subform would requery...

can you describe the circumstances under which the record pointer is set
back?

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
J

Jerry Porter

Hi Crystal,

If I select a record in the listbox in the main form, the subform
displays the related records with the focus on the first. If I select a
different record in the subform, the focus momentarily goes to that
record, then immediately pops back to the first record.

I also noticed that when I try to apply conditional formatting to a
control in the subform, the control flickers for a while, and then
Access crashes. It seems to be continually calculating the condition.

I said Friday that I made a bare-bones subform and the problem still
occurred. But just now, I made a new mainform/subform on different
tables, with the main form being an unbound list box. The problem did
not occur. So my guess that the unbound listbox was the culprit is not
right.

Jerry
 
J

Jerry Porter

I've found the problem. My Link Master Field is not tied directly to
the listbox, but rather to an unbound text box that selected a column
of the listbox. It's amazing it works as well as it does.

I think the solution is to get rid of the unbound text box and use code
to filter the subform, instead of the Link Master and Link Child
fields.

Thanks for your help!

Jerry
 
S

strive4peace

you're welcome, Jerry ;) happy to help

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

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