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

Forms won't open in Access 2007 1

Status
Not open for further replies.

ajaeger

Technical User
Feb 6, 2003
201
US
I have a database that was originally written in Access 2003. Now when it's opened in 2007, none of the DoCmd.OpenForm "frmABC" commands work. My forms won't open. If I create a new form and create a command button with DoCmd.OpenForm "frmABC", it doesn't work. If I follow the wizard (which creates the same command), it doesn't work. If I create a new database, create a new form and run the wizard to create a new command button to open a form, it works. I noticed that the new database is saved as an .accdb where my database is a .mdb. Also the open form code is in an embedded macro instead of in the VB code window. Do these play into why I can't open my forms in my 2003 .mdb file?

Anna Jaeger
iMIS Database Support
 
Do you get a little warning at the top, saying something like "Certain content in the database has been disabled" with an Option button beside? This is the new "enable macro dialog"

Else, ensure you've put the database in a trusted location.

Office Button | Access Options | Trust Center | Trust Center Settings. In the Macro Settings category, I use "Disalbe all macros with notification", and for Trusted Location, select the location of the db.

Roy-Vidar
 
accdb is the new format for 2007 while .mdb was 2003's format. the DoCmd.OpenForm "frmABC" should work if you do what RoyVidar said. you might want to add more to you DoCmd.OpenForm "frmABC". this is the syntax for 2007 OpenForm:

DoCmd.OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)

The FormName is the only required field, but it might help if you add a little more. as for the embedded macro, if you are in 2007 and you are in design mode on a form, right click on a button you made and click Build Event... this will give you 3 options, Macro, VBA, and something else. if you click VBA, the VBA window should open.

Hope this helps,

Valgore
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top