By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,627 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

Subform Cursor Gone Wild

P: 7
Hi All,

I have a mainform that hold a template for house remodeling. Then I have a subform that holds the tasks needed to accomplish the house remodel. The subfrom is a list of continuous records. On particular fields in the subform, I use an append query to add records as needed. The problem is that once the append takes place the cursor goes back to the first record. How do I get the cursor to stay on the new appended record.

Similar to the above problem, there are certain fields in the subform that are updated. When a value is changed, a macro runs that includes an update query to update the cost totals on the subform and on the mainform. When finished, the cursor jumps to the mainform and has the first record selected in the subform. I just want it to go to the next field in the subform as if I had no macro at all.

The macro looks like this:

Save Record
Open Query (update query)
refresh
removefiltersort

Any ideas on how I can tame the wild cursor?

Thanks!
Aug 14 '07 #1
Share this Question
Share on Google+
7 Replies


ADezii
Expert 5K+
P: 8,669
Hi All,

I have a mainform that hold a template for house remodeling. Then I have a subform that holds the tasks needed to accomplish the house remodel. The subfrom is a list of continuous records. On particular fields in the subform, I use an append query to add records as needed. The problem is that once the append takes place the cursor goes back to the first record. How do I get the cursor to stay on the new appended record.

Similar to the above problem, there are certain fields in the subform that are updated. When a value is changed, a macro runs that includes an update query to update the cost totals on the subform and on the mainform. When finished, the cursor jumps to the mainform and has the first record selected in the subform. I just want it to go to the next field in the subform as if I had no macro at all.

The macro looks like this:

Save Record
Open Query (update query)
refresh
removefiltersort

Any ideas on how I can tame the wild cursor?

Thanks!
Try this Link first, if it doesn't help then respond to the question.
http://www.thescripts.com/forum/thre...-bookmark.html
Where is the Update Query being run from?
Aug 14 '07 #2

P: 7
Thanks much for the answer. I will try it out now. The query is being run from a macro, After reading some of the the posting here I'm beginning to realize that running anything from a macro may not be the best idea. Thanks and I will let you know if this works.
Aug 16 '07 #3

missinglinq
Expert 2.5K+
P: 3,532
That's right! Macros are rigid and very limited in the abilities, and more importantly, have no provision for error handling!

Welcome to TheScripts!

Linq ;0)>
Aug 16 '07 #4

P: 7
Thanks. The code works and brings me back to the record which is great(!) but it doesn't bring me back to the correct fieild--so I'm almost there. Is there a way to bookmark the exact field?
Aug 16 '07 #5

ADezii
Expert 5K+
P: 8,669
Thanks. The code works and brings me back to the record which is great(!) but it doesn't bring me back to the correct fieild--so I'm almost there. Is there a way to bookmark the exact field?
You can experiment with code similar to that which is listed below:
Expand|Select|Wrap|Line Numbers
  1. Static ctl As Control
  2.  
  3. 'Set the Absolute Path to your Control
  4. Set ctl = Forms!frmEmployees!subfChild.Form![FirstName]
  5.  
  6. DoCmd.OpenQuery "<Action Query here>"
  7.  
  8. 'Return Focus to the Original Control
  9. ctl.SetFocus
Aug 17 '07 #6

P: 7
Works Perfect. Thanks for all of your help!
Aug 30 '07 #7

ADezii
Expert 5K+
P: 8,669
Works Perfect. Thanks for all of your help!
Glad it worked out for you.
Aug 30 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.