Move to new record

  • Thread starter Thread starter Manuel
  • Start date Start date
M

Manuel

I have what I think is a real simple question. I have a form with several
subforms on various tabs. What I want to do is have the form automatically
go to a new record when the user clicks on the tab. I understand that this
can be accomplished by setting the Data Entry property on the Sub Forms to
TRUE, but I want the users to be able to navigate back to earlier entries
using the forms navigation buttons.

So, how would I do this?

I tried inserting the below code in the OnOpen Event of the subform, but
received an error message:

DoCmd.GoToRecord acDataForm, "Forms!MainForm!Tracking_Form", acNewRec

Placing the code in the GotFocus Event does nothing.

I would appreciate any assistance you’ll can provide.

Thanks!

Manuel
 
Hi,
you have to set focus to subform, then to some control on it and then run
docmd.gotorecord:

me.Tracking_Form.SetFocus
me.Tracking_Form.form!SomeField.SetFocus
DoCmd.GoToRecord , , acNewRec

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 

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

Similar Threads


Back
Top