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

Adding a new record to a subform (datasheet)

Status
Not open for further replies.

Introfield

Instructor
Apr 19, 2002
21
0
0
IT
I have a form which contains a subform
Main form shows company details, subform shows history or contact/communication with that company. My client would like to have the blank row (new record) appear at the top of the datasheet subform and not the bottom to speed up data entry.
My alternative solution was to use a "go to new record" macro/module on activating the subform but it doesn't work.
Can you help please?
 

Hi:

Put this in the On Open event of the form:
Code:
        DoCmd.GoToRecord , , acNewRec

Ought'a work. Gus Brunston [glasses] An old PICKer, using Access2000.
 
Thanks for your quick response. I'm sure I tried this already and had a problem because the new record is to be added to the subform (in datasheet view) and the subform is opened at the same time as the main form.
 

Hello:

Don't put the code in the main form.

Open the sub form by itself. Open the property sheet for the sub form and enter the code. Gus Brunston [glasses] An old PICKer, using Access2000.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top