Setfocus on main form from subform?

L

Lostguy

Hello! On the main form (frmEventEntry), I enter the EventDate and
then select the Event from a combobox. Then, on the continuous subform
(subfrmEventEntry), I select the names of each of the employees who
did that event. Then, I click the "Next Record" button on the main
form. I do this over and over: Date, Event, select Employees, click
Next Record.

The problem is when I click Next Record and the new blank main form
appears, the cursor is still in the subform instead of being "ready to
go" in the EventDate field. So, my sequence ends up being: Date,
Event, select Employee, click Next Record, and then click EventDate on
the new record to get the cursor up there.

I have put the setfocus command all over the place, but I am either
getting the syntax wrong or not putting it in the correct form (or
subform) Event Procedure.

I appreciate any help with eliminating the extra mouse click!

VR/Lost
 
J

John Spencer

Have you tried the current event of the main form to set the focus to the
control on the main form?

I might add my own button on the main form to move to the next record (or new
record) and then you could use code in that to set the focus.



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top