Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Setfocus using Navigation form

Posted on 2011-09-03
4
Medium Priority
?
850 Views
Last Modified: 2013-11-28
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.
0
Comment
Question by:devander
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:c1nmo
ID: 36478320
[BarQCProdForms].Form![InspectorName].Setfocus
0
 

Accepted Solution

by:
devander earned 0 total points
ID: 36478375
Thanks for the suggestion, but it did not work either for my particular case. But! I did find a much simple solution that I kick myself for not thinking to use before"

Me.InspectorName.SetFocus

duh!
0
 

Author Closing Comment

by:devander
ID: 36501235
Sometimes, just asking the question forces us to rethink the problem...
0
 
LVL 6

Expert Comment

by:c1nmo
ID: 36478399
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
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question