Opening a form in "NEW" data mode as opposed to showing existing records

pam0566

Registered User.
Local time
Today, 01:43
Joined
Jun 6, 2008
Messages
132
How do i force a form to open in INPUT mode as opposed to opening showing existing records?
 
I dont ONLY want it to open that way. When i use the switchboard to "add" i m only in data entry mode. I want to be able to open form with no record showing, but all my records there if i want to use the arrow key etc.
 
I am interested in the answer to this as well. Anyone?
 
Code:
Private Sub Form_Open(Cancel As Integer)
    DoCmd.GoToRecord , , acNewRec
End Sub
 
Thanks for the help. But could you help out this relative newbie and either (1) describe step-by-step where/how to enter this code or (2) describe an easier, more user friendly way to accomplish the same thing? For instance, is there a setting in Properties somewhere that will accomplish this? Thanks again.
 
go to the form design view and in the properties window click on events, then in the list locate the OnOpen event and click the three dots ... next to it and choose code builder.

Then type the above suggested code there.
 
Here's a quirk to add to the mix. I got this to work on my computer. But when I save and close the database file, then open it using another computer on the network and open the form, it does not open to a new, blank record. I checked the code and it is still there. Any ideas on this one?
 
Anyone have an idea on this one? Why it work on one PC and not on others?
 
go to the vba editor and from the toolbar select Tools -> References and check that both databases have the same references ticked.
 

Users who are viewing this thread

Back
Top Bottom