Set Focus

  • Thread starter Thread starter myxmaster
  • Start date Start date
M

myxmaster

I have a command button that displays and filters 2 forms. I would
like to set the focus to a specific field on another form when these
are opened.
TIA
 
In
I have a command button that displays and filters 2 forms. I would
like to set the focus to a specific field on another form when these
are opened.

Something along the lines of:

DoCmd.OpenForm "Form1", WhereCondition:="[SomeField]=1"
DoCmd.OpenForm "Form2", WhereCondition:="[SomeOtherField]=2"

With Forms!Form3
.SetFocus
!SomeControlOnForm3.SetFocus
End With

That's assuming that Form3 -- is already open. If it's not, just open
it, and then set the focus to the control on it:

DoCmd.OpenForm "Form3"
Forms!Form3!SomeControlOnForm3.SetFocus
 
Back
Top