Page Down Problem

I have a single record subform (not continuous) based on a table with a one to one relationship with the main form table.

I have removed record navigation and set the subforms enter control to cycle the one record
This means I can prevent users trying to move to a new record on the subform. Except they can use the page up page down keys on the keyboard which moves to a new record.

What I do not understand is if two tables, form and subform, have a one to one relationship, why does access even allow moving to a new record on a subform with such a link and how do I prevent it.

In a query using main and subform tables where the subform has two records the query would duplicate the main form details an double the number of items. That's a disaster.
Derek BrownMDAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

clarkscottCommented:
In the KeyDown event of EACH field in subform:

If KeyCode = vbKeyPageUp Or KeyCode = vbKeyPageDown Then
    Me.{any OTHER field in your form}.SetFocus
End If


Also, in the OPTIONS of Access - CLIENT SETTINGS: Set CURSOR STOP AT FIRST/LAST FIELD to True.

Scott C
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<
What I do not understand is if two tables, form and subform, have a one to one relationship, why does access even allow moving to a new record on a subform with such a link and how do I prevent it.
>>

   That type of restriction is simply not built-in.  While bound forms do a lot, they don't do everything.   A M-M is another case when they simply don't handle it.  

   The 1-1 is a restriction of the relationship at the engine level.   You need to keep in mind that "Access" is really made up of three seperate things.   In this case your just giving it more credit then it deserves.

  Follow Scotts advice and you'll be fine.

Jim.
0
Derek BrownMDAuthor Commented:
Thank you both
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.