Go to Field?

K

K

Good day

I have a two tabs in a form (FrmMain). When the user clicks on btnNewQuote I
would like it to go to the first tab and set focus on a field called
CbxSalesName.

Any help would be appreciated.

Thanks Kyle.
 
D

Douglas J. Steele

Do you have a subform on the tab, or strictly fields from the form?

If it's strictly fields from the form, the fact that it's on a tab is
irrelevent: you simply need to use

Me!CbxSalesName.SetFocus

If it's a subform, you need to set focus on the subform control first, then
on the control on the subform:

Me!SubformControlName.SetFocus
Me!SubformControlName.Form!CbxsSalesName.SetFocus
 
K

K

Thank you. One more issue I am having with this.

First Tab control in a form called frmMain I have a field called CbxTerms
and on lost focus I want to go to the next tab where there is an embeded
subform called frmProjects and in that form to a field called CbxProdutCat

Your help is appreciated.

Kyle.
 
D

Douglas J. Steele

Depending on how you added frmProjects as a subform, the name of the subform
control may be something other than frmProjects.

If

Me!frmProjects.SetFocus
Me!frmProjects.Form!CbxProdutCat.SetFocus

doesn't work, replace frmProjects with the name of the control.
 

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