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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FORM CLOSES AND DOESN´T SET FOCUS TO OTHER FORM

Status
Not open for further replies.

fsweb2002

Programmer
Apr 11, 2002
94
0
0
TR
Hi

I have a FORM ("Quotes") which opens another form ("Clients") when I double click on a field.
The "clients" form has a cmdclose button with the following code in it...
Everything works fine HOWEVER the original FORM [Quotetype] field doesn´t get the FOCUS with the code below.
So I have to click on the form again to continue working with it...

What am I doing wrong ?

Thanks in advance.


Private Sub cmdclose_Click()

If IsLoaded("Quotes") Then
Form_Quotes.ClientName = Me.ClientName
Forms!quotes.ClientName.SetFocus
Forms!quotes.ClientName.Requery
Form_Quotes.QuoteLines_Subform.Form![QuoteType].SetFocus

Else

End If
DoCmd.Close
End Sub
 
I think its....

Forms!MainForm!Subform.SetFocus

i.e.

Forms!Form_Quotes!QuoteLines_Subform.SetFocus
 
dear seb2,

sorry, I´ve tried Forms!Form_Quotes!QuoteLines_Subform.SetFocus but it doesn´t work (error 2450 form "Form_Quotes" cannot be found.

But the form Quotes does exists for sure...

Anymore ideas...??
 
If you are sure there aren't any typos, perhaps you need to actually refernce a field of the subform that has focus and not jus the entire form.

Forms!Form_Quotes!QuoteLines_Subform!Quote_Id.SetFocus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top