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

Open a form with a blank record

Status
Not open for further replies.

arlequin

Programmer
Sep 21, 1999
232
0
0
UY
Hello!

I want to open a form in order to insert a new record by default, but Access loads the last record instead.

How can I start a form with no data on it?
I mean... all fields blank... :) Arlequín
arlequin@montevideo.com.uy
 
bobbster2000,

Thanks for answering. The form is opened by a command button placed in another form caller Main Menu.... Arlequín
arlequin@montevideo.com.uy
 
In the event the form is called by an event procedure, what code would open the form with a new record?
Thanks!
 
In the "On Load" Event of the form you would place this line.

DoCmd.GoToRecord , , acNewRec

For common functions like this, use the wizards for the command buttons like new record, delete record, go to record etc, and then cut and paste the code to the event that you want. That is how I got that piece of code. It is a really quick way to get some of the generic code that will work everywhere.
 
You could also set the data entry property of the form to true. But this hides all of the previous records.
LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top