Opening a form to a New Record

  • Thread starter Thread starter Chip
  • Start date Start date
C

Chip

Howdy for Oklahoma!!!

I am new to ACCESS and really new to VB so be gentle with the VB jargon
please.

I am wanting to open a form that i want to be able to scroll thru all the
records but i want the form to open to a New record instead of the first
record as it does by default. Is there any way to do that???

As always THANKS IN ADVANCE!!!
 
Chip said:
Howdy for Oklahoma!!!

I am new to ACCESS and really new to VB so be gentle with the VB jargon
please.

I am wanting to open a form that i want to be able to scroll thru all the
records but i want the form to open to a New record instead of the first
record as it does by default. Is there any way to do that???

As always THANKS IN ADVANCE!!!

In design view open the property sheet to the { Events } tab for the form. Find
the OnOpen event box. From the list of choices in the drop down list choose
"[Event Procedure]" and then click the build [...] button to the right. That
will open the VBA code editor window.

Between the first and third lines below enter...

Private Sub Form_Open(Cancel As Integer)
DoCmd.RunCommand acCmdRecordsGoToNew
End Sub

Note that this is not recommended on forms bound to tables with lots of records
as it causes unnecessary amounts of records to be loaded (particularly in a
networked app). Better is to just open the form ONLY at a new record and then
use filtering tools if you want to see others.
 
Back
Top