Set Focus to New Record

D

dd

I have a form where allow additions = false. A button
called "Add New" can be clicked and the code behind it is
Me.AllowAdditions = True. A new record then opens but I
cannot find a way to set focus to the new record. The form
is continuous and it contains only one text box which
displays all of the records in the form. I need to find a
way to set the focus to the record which contains no data.
Thanks, and happy weekend.
 
W

Wayne Morgan

DoCmd.GoToRecord acDataForm, Me.Name, acNewRec

Place this in the button's code after the Me.AllowAdditions line.
 

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