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

Cursor goes to a new record when opened?

Status
Not open for further replies.

MariaL

Instructor
Jun 23, 2003
50
US
Hello everyone. I have a subform that displays many records. I need the cursor to automatically go to a new record on the subform. I can not use the data entry property because I need all records to show. Any ideas on how to accomplish this? I appreciate your time and help. Have a great day.
 
properties event On Load

public sub FormName_OnLoad
DoCmd.GoToRecord , , acNewRecord
end sub
 
Use a new entry button is one way. Another might be to do a

doCmd.GoToRecord ,, acNew


with the open_form event.


Rollie E
 
Thank you for your reply. This works great on the form. But when I add it as a subform, and pull up the main form record with a combo box, the subform will not go to the new record. Any ideas?
Thank you for your time.
 
Maria,

Open the subforms' recordset, add a new record and requery the subform. If you need help with the code, ask.

Rollie E

Remember: If these tips help vote the helper a star in the "Mark this time as helpful... "
 
Thank you Rollie, but I'm clueless. How do I get to the recordset? What steps do I take when I get there? Thank you. I will be sure to mark all your replies. I appreciate your help.
 
If you click on the subform properties and look at the datasource, you will see the Table/ Query that populates it. That is the table you need to add a new record to. Send me a small sample of your database in zipped form and I will return it with the code.

rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top