Subform to Form -- SetFocus

  • Thread starter Thread starter Joy M
  • Start date Start date
J

Joy M

Hi -

Is it possible (given that I am in a subform) to use VBA to set focus to a
command button on the form (that contains the subform)?

Thank you for your help,

Joy
 
Certainly! Me.Parent.cmdButtonName.SetFocus

Using your cmbButtonName of course.

Hi -

Is it possible (given that I am in a subform) to use VBA to set focus to a
command button on the form (that contains the subform)?

Thank you for your help,

Joy
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
And please ignore the buttom part of my post, its not relevant to you
--
This one - >
(If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.)

Good luck
 
I missed the setfocus in the second option
Forms![MainFormName]![CommandButtonname].Setfocus
 
Hi -

Thanks for your quick responses. They worked fine.

I was using a period instead of an exclamation mark in mine.
I.e., I had Forms.[MainFormName].[CommandButtonname].Setfocus but it didn't
work

How do you decide when to use ! and when to use a period in this syntax?

Thanks again,

Joy
 
Back
Top