Easy Question

quasar900

quasar900
Local time
Today, 10:41
Joined
Nov 18, 2005
Messages
14
This has probably been answered - but didn't know what "text" to use to search for it.

When I open a form to add a record to a data base it opens with the first record in the file, then I would hit the arrow+star at the bottom to get to a blank form for entry.... I just want the data base to open up to the blank form. How do I do this.

Thanks for your help
Quasar
 
Go to the form's Open event and make it like this:

Code:
Private Sub Form_Open(Cancel As Integer)

    DoCmd.GoToRecord , , acNewRec
    
End Sub

Simple questions get simple answers. ;)

~Moniker
 
Very Literal

I took your advice - very literally - cut and pasted into the form property "on Open" and it gave me an error

Microsoft Office Access can't find the macro 'Private Sub Form_Open(Cancel As Integer)

DoCmd.

The macro (or it's group macro) doesn't exist.... etc.

Was there more to the simple answer. Very new at this.

Thanks
 
Go to Design View on your form, click the top left of the form to make sure you have the form selected. Open the properties page (press F4) and scroll down to the "On Open" event. Click the builder icon next to it (the button with "..." in it), and if will ask you what sort of builder you want. Click "Code Builder". That will build the Open routine for you. In the Open subroutine it created, place the DoCmd.GoToRecord , , acNewRec in there. That should do it.

~Moniker
 
Last edited:

Users who are viewing this thread

Back
Top Bottom