Focusing a subform

Z

Z. Ishtiaque

I am facing a problem. I have a main form whose fields are unbound. On the
main form I save data using a command button with VBA codes. At the end of
the code I tried to write a code for focusing the cursor on a bound subform
which is linked with 4 fields of the main form. When the save button is
clicked sometimes it focuses to the subform sometimes does not. It gives a
message "Focus cannot move to the control". Again when I use mouse to focus
to the subform sometimes it gives the message like "Index or Primary Key
cannot contain null value". I am not sure why the problem is happening. Is
anyone has any solution on this problem?

Ishtiaque
 
B

bhicks11 via AccessMonster.com

Are you adding a new record? Have you tried requery before moving? What
process are you doing when you try to move? Is the control that you want to
set focus on enabled?

Bonnie
http://www.dataplus-svc.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