Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set focus?

Status
Not open for further replies.

aqm

Programmer
Aug 26, 2002
65
0
0
AO
hi,
how to set focus on a subforms?
please help.
aqm
 
forms![Your Main Form Name]![Sub Form Name].form.setfocus

ie

forms!frmCustomerMain!subFrmCustomerMain.form.setfocus

or maybe a control in the sub form

forms!frmCustomerMain!subFrmCustomerMain.form!txtCustomerNo
 
HI,
THANKS. I WANT TO KNOW HOW TO SET FOCUS ON A FIELD OF AN SUBFORMS AND IF THE INFORMATION I WANT IT TO DISPLAY IS NOT THAT, THEN IT MUST RETURN TO THE SAME FIELD AND NOT MOVE TO THE NEXT FIELD.
HOW DO I DO IT?
AQM
 
Hi again,

ok something like this;

if forms![yourMainForm]![YourSubForm].form![YourField] = 'Hello' Then
forms![yourMainForm]![YourSubForm].form![YourField].setfocus
else
me.[FieldOnMainForm].setfocus
End If

That what your thinking??

Scott

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top