Refreshing main form and subform

new_2_prog

Registered User.
Local time
Today, 15:03
Joined
Aug 4, 2008
Messages
58
I have a main form with calculations and a subform with that has continuous lines and in the footer of the subform is a sum text box.
In the subform after it moves off the Qty text box I have
Me.Refresh 'Refreshes subform
Me.Parent.Refresh 'Refreshes main form

Problem is when its done refreshing these when it comes back to subform it goes to the first field at the top of subform lines instead of going to the next box, why is this? I did the setfocus but same thing top left. Is there some code to fix this or can someone explain why? I think its because it leaves the subform and then comes back and its just automatic that its starts in the top left.

Thanks!
 
Try using the following after your refresh command;
Code:
DoCmd.GoToRecord acDataForm, "FRM_YourFormName", acNewRec

Use acLast if you simply want to go to the last record rather than a new record, and remember you will need the correct reference for your SubForm Name
 
I ended up putting:
Me.subfrm_Special_Total.Requery
Me.Refresh
in the main form, works fine but I noticed with my subform when I have say 10 lines and the subform is shrunk and can only show say 3 at a time there seems to be a timing issue of the subfrm total box updating versus if I made the subfrm big enough to show all 10 at once - why is this? Is there a way to work around this?
 

Users who are viewing this thread

Back
Top Bottom