SetFocus on Subform Not Working

M

MBoozer

I have a subform(ChemList) that is visible=false until the user clicks a
control (Manage) on the main form(ChemicalInventory) to make it visible. All
I want to do (haven't we heard that many times over) is move the focus to a
field (ChemName)on the subform when it is visible = true. I set the following
code on the main form control (Manage) on-click event:

Forms!ChemicalInventory!ChemList.Controls!ChemName.SetFocus
I get no erros but also get no focus. I tried setting it on the main form on
current event but you have to click somewhere in the subform when it is
visible to get it to set focus. Other variants I tries come back with an
error that it can't find the form "ChemList". Any ideas?
 
T

tina

try setting the focus to the subform first, then to the subform control, as

Me!ChemList.SetFocus
Me!ChemList!ChemName.SetFocus

hth
 
M

MBoozer

Worked great! Thanks a mil Tina!

tina said:
try setting the focus to the subform first, then to the subform control, as

Me!ChemList.SetFocus
Me!ChemList!ChemName.SetFocus

hth
 

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