Link to home
Start Free TrialLog in
Avatar of devander
devander

asked on

Setfocus using Navigation form

I developed a group of forms that I then moved into a Navigation Form. When testing this code from just the original form (not in the Navigation form) it worked fine:

Private Sub StopField_Enter()
Forms!BarQCProdForms!InspectorName.SetFocus
End Sub

The Form name is BarQCProdForms and the field I set the focus to is InspectorName

My Navigation form name is E1E2Forms and now the BarQCProdForms is within that.

When I test while in the Navigation form I get the error message :

Run-time error ‘2465”:
Microsoft Access can’t find the field ‘InspectorName’ referred to in your expression.

I tried several things including changing BarQCProdForms to E1E2Forms within the Forms! Statement.

Thanks for any help you can provide.
Avatar of c1nmo
c1nmo
Flag of United Kingdom of Great Britain and Northern Ireland image

[BarQCProdForms].Form![InspectorName].Setfocus
ASKER CERTIFIED SOLUTION
Avatar of devander
devander

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of devander
devander

ASKER

Sometimes, just asking the question forces us to rethink the problem...
I see, I read it as being set from the parent form, not within the subform.  Looking for a problem when there wasn't one lol