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

Sub not working !

Status
Not open for further replies.

andrep

Technical User
Feb 27, 2002
40
CA
stDocName = "Ventes (Dernier)"
DoCmd.OpenQuery stDocName, acNormal, acEdit
lin3 DoCmd.GoToRecord , , acNewRec

I have a sub witch runs a query, once the query has run!
I want the form to goto a new record!

The line 3 is not working, is this because the form has
lost the focus to the query ???

The sub is called from a command button !

I can't figure why line 3 is not functionning !

Any ideas !
 
You are correct about the focus. The query has the focus. You can use the statements:
Code:
Me.SetFocus
Me![Field Name for Cursor].SetFocus
between running the query and positioning to a new record to get the focus back on your form. You'll also need to position your form and query windows so that they're both visible, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top