Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2008, 12:45 PM
Registered User
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default DoCmd.OpenForm does not work

Hi,

I created a form that contains a button (MS Access 2007). With this button I want to open a second form. Unfortunately the second form does not open. Nasty detail: The button (and the code below) are generated by the button-wizard.

Code:
Private Sub Knop111_Click()
On Error GoTo Err_Knop111_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Adres_Bewerken"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Knop111_Click:
    Exit Sub

Err_Knop111_Click:
    MsgBox Err.Description
    Resume Exit_Knop111_Click

End Sub
Any clues?
 
Old March 25th, 2008, 06:45 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I would look at whether the form was open and behind the first form (which your code indicates is not closed when the new one opens). I would also look at the second form to see if there was some code the prevented it from being shown. Also, does it need to be a Pop-Up form? I don't like Access 2007.

mmcdonal

Look it up at: http://wrox.books24x7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
DoCmd Openform arguments BBWEST Access 1 August 21st, 2008 10:23 AM
DoCmd.OpenForm BBWEST Access 1 August 21st, 2008 10:02 AM
DoCmd.OpenForm turp Access VBA 2 December 15th, 2006 08:33 AM
AccessVB: DoCmd.Openform awillis40 Access VBA 2 December 10th, 2006 06:08 PM
How does DoCmd.OpenForm work? Brian263 Access 3 November 23rd, 2004 10:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.