Solved

Setfocus using Navigation form

Posted on 2011-09-03
4
815 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Correct ordering 16 48
microsoft access - xml 10 29
Query 14 19
DSum between dates 5 11
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now