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!

Simple Help 1

Status
Not open for further replies.

thelke

MIS
Apr 9, 2002
84
0
0
What would the OnLoad() VBA code be for a form, so it opens in ADD mode instead of EDIT mode. Did this make sense?
 
hey hey

Try this when you open the form in vba

DoCmd.OpenForm "formname", , , , acFormAdd

Cheers
Vince
 
ok, still not working. I have a switchboard with a treeview. now, when I clikc on the link for this form, it opens it in the parent area, AND opens an instance of itself OUTSIDE of the form.
 
Hi!

If you need to use the Load event then use:

Me.AllowEdits = False
Me.AllowDeletes = False
Me.AllowAdditions = True

Of course, you will need to make it conditional somehow or the form will always open in add mode.

BTW, Vince's code works well, but you can not use it in the Load event, it must be used when opening the form in code.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top