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

Cursor Control

Status
Not open for further replies.

willsth

Programmer
Oct 3, 2008
33
GB
I have a Main-Form with 2 sub-forms and I am using the sub-forms for data entry.

The problem I have is that when the user completes an entry on the sub-form the cursor moves back to the Main-Form and I want it to move to a new record on the appropriate sub-form.

How do I achieve this ??
 
You could use the Lost Focus event of the last control on subform 1 to move to the first control on subform 2

Code:
Private Sub ControlZ_LostFocus()
'You need two jumps
Me.Parent.Subform2ControlName.SetFocus
Me.Parent.Subform2ControlName.Form.ControlA.SetFocus
End Sub
 
Sorry what I meant to say was that I want the cursor to remain within the sub-form that I'm entering data into, just to jump to a new record !!
 
That is what would happen in a subform set up normally. This implies that you have changed something. Does your subform have coding that jumps the cursor to the main form?
 
You're right I put in a re-query command to refresh totals - I've just removed it and it seems OK

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top