Did that work for you?
Did that work for you?
So far I managed to identify and store the name of the field which had the focus on the sub form before the sub form losses the focus.
Now I need to set the focus to that field :
Forms(aaa).Forms(bbb).Controls(ccc).SetFocus
aaa is the main form name (variable)
bbb is the sub form name (variable)
ccc is the field name in the sub form (variable)
NOW this does not work!!!!????
Any ideas?
just got here, but try gotocontrol...
docmd.gotocontrol "your field name here"
or you could try reopen or make visible the form/subform again and on the onopen command check for your field name on the main menu if it's there use that in the above line to go to the required field. you will need to play around with the variables.
You could also try:
Me.bbb.Form.ccc.Setfocus
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
Thanks everybody. It seems that it's going to work. I am getting there!! I will keep you informed. Cheers
This job is making me crazy!!!!!!!!!
PLEASE PLEASE have a look at the attached file. I explained what happens on the FRM1 form (label).
I hope hope hope someone can tell me whats wrong.
Thanks
Somebody .................................Please.!!!!!!!!!! !!!!!!!
![]()
A search in Google suggests that your problem has been encountered by others before you. It would seem that the problem lays with setting the focus. The general consensus of opinion would seem to be that it is better to either create a “Find” button which will open a dialog window in which the text to be searched for, the field to be searched and the direction, can all be selected. The alternative is to set a filter on the sub form.
Take a look at the attached db. It does not solve the issue you had but it may help to show you how the alternative suggestions might work.
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
Thanks a lot for the reply.
Appreciate your time.
Cheers
Found this in another forum. It was written long ago, but still is very useful.
Syntax for Subforms.zip
It's not easy to upload a simple Word doc here, is it?
_________________
Regards,
Marvin M
Windows 7 Professional, MS Access 2007/2010
Windows 8 Professional, MS Access 2013
-------------------------------------------------------------------------------------------------------------------
If this post has helped you, please click on the little sheriff badge in the lower left corner. Thanks!
-------------------------------------------------------------------------------------------------------------------