set focus to control on subform

0

0 1

From the OnCurrent event of a subform (fsubA), I am trying to set the
focus to a control on another subform (fsubB).

These are not nested subforms - they are both subforms of the main
form (frmMain).

I keep getting this error: "You entered an expression that has an
invalid reference to the property Form/Report."

Below is the code I'm using, and I can't see what I'm missing. I've
also tried putting the arguments in brackets, and I've tried not
setting focus to the subform.

Private Sub Form_Current()

Forms!frmMain.fsubB.SetFocus
Forms!frmMain!fsubB.Form.cmdAddEvent.SetFocus

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top