Go to new record on click/open

mapondera

Registered User.
Local time
Today, 23:33
Joined
Sep 12, 2001
Messages
33
I have a command button that opens up a form. How do I
1. get the form to open up to a new record
2. get the form to open up only to a new record i.e. make previous records invisible/un-editable
 
For option 1, go to design mode on the form. Open up the form properties and click on the 'Event' tab, scroll down to 'On Load' and build a procedure in the Code Builder. This is the code you need to go to a new record on form open.

Code:
Private Sub Form_Load()
DoCmd.GoToRecord acDataForm, "Elements", acNewRec
End Sub

For option 2, in that same form properties popup, click on the 'Data' tab and set 'Data Entry' to 'Yes'.

Good luck.
 
It worked. I just had to replace "Elements" for the name of the control.

Thanks
 

Users who are viewing this thread

Back
Top Bottom