Matt Greatorex
Registered User.
- Local time
- Yesterday, 20:15
- Joined
- Jun 22, 2005
- Messages
- 1,019
I have a field on a form that displays a list of people. In most cases, one record = one person, but in a few one record = one team of two or more people.
Selecting a record causes the rest of the form to be populated. This works fine.
What I've added is as follows:
1) User enters a name and hits <Enter>
2) If the name relates directly to a record for one person, code acts as before.
3) If the name is part of a team, a second field is made visible, enabled, and set to contain only those records that might relate to the entered name. This works fine.
If the second case is true, however, I want focus to shift from the first field to the second. I'm trying to use
but I get a message saying
'Microsoft Access can't move the focus to the control cbo_Possibilities'
I've checked the properties of both fields and they appear to be identical. What else can prevent SetFocus from working?
Selecting a record causes the rest of the form to be populated. This works fine.
What I've added is as follows:
1) User enters a name and hits <Enter>
2) If the name relates directly to a record for one person, code acts as before.
3) If the name is part of a team, a second field is made visible, enabled, and set to contain only those records that might relate to the entered name. This works fine.
If the second case is true, however, I want focus to shift from the first field to the second. I'm trying to use
Code:
[Forms]![frm_NBDash-IA]![cbo_Possibilities].SetFocus
'Microsoft Access can't move the focus to the control cbo_Possibilities'
I've checked the properties of both fields and they appear to be identical. What else can prevent SetFocus from working?