In the header section of a form is an unbound box to type in either LastName or FirstName, depending which field radio button was selected (I always have it set to LastName). I would like the cursor to be on this unbound box when the form is opened. Right now the cursor blinks on the first record in the membershipID field, in the data section.
I do not know VBA and have had help in the past from forum members. This particular form I think was given to me from someone here, and when a record is selected it opens the main posting form/with subform, which I did design.
The issue is that I want the cursor to blink on the unbound (txtfinder) box (the blank box above the "Find Next" when the form is opened so all I have to do is type in the box, rather than first mouse-click that box.
I tried this code based on researching – but it does not work.
Private Sub txtFinder_BeforeUpdate(Cancel As Integer)
Dim hit As Control
Set hit = Me(frmMemberFinderNext)
hit.SetFocus
End Sub
This is the form in Form View (with fictitious member names – I copied the database and deleted all except five records and changed the names, etc for those five). Following the Form View is the Design View for the form.
Any help with getting the focus on the unbound TxtFinder box when the form opens would be appreciated.
Thanks.
I do not know VBA and have had help in the past from forum members. This particular form I think was given to me from someone here, and when a record is selected it opens the main posting form/with subform, which I did design.
The issue is that I want the cursor to blink on the unbound (txtfinder) box (the blank box above the "Find Next" when the form is opened so all I have to do is type in the box, rather than first mouse-click that box.
I tried this code based on researching – but it does not work.
Private Sub txtFinder_BeforeUpdate(Cancel As Integer)
Dim hit As Control
Set hit = Me(frmMemberFinderNext)
hit.SetFocus
End Sub
This is the form in Form View (with fictitious member names – I copied the database and deleted all except five records and changed the names, etc for those five). Following the Form View is the Design View for the form.
Any help with getting the focus on the unbound TxtFinder box when the form opens would be appreciated.
Thanks.