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

Position Cursor on new record in a subform

Status
Not open for further replies.

CHTHOMAS

Programmer
Jun 16, 1999
106
AE
Am having a main form with 2 subforms. subform1 and subform2. Subform2 records are based on subform1 records. The users make entry in subform2. I would like to have the cursor positioned on the last record on subform2 instead onthe first record. The same even when the user navigates through the records on subform1. I tried the command ( DoCmd.GoToRecord , "", acLast), but not working correctly. Any solution?

Regards,

Charley


 
In the Main Form in the On Enter event of subform2 paste:

DoCmd.GoToRecord , "", acLast

In the YourSubForm1Name's On Current event paste:

Forms!YourMainFormName!YourSubForm2Name.SetFocus
Forms!YourMainFormName!YourSubForm1Name.SetFocus

This should do what you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top