Results 1 to 4 of 4
  1. #1
    librarian is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    3

    Report not opening from navigation form

    I have a form that works perfectly fine on its own, but for some reason when it is embedded in my navigation form I get a strange popup. Here's a basic description of how things should function (and do on their own):

    frmJudgeType contains combo box with three choices and an OK button
    user makes selection in combo box, hits OK and runs qryJudgeType which produces rptJudgeType

    When the form is used within the Navigation Form, however, clicking OK produces a popup that reads:

    Enter Parameter Value:
    Forms!frmJudgeType!cboJudgeType
    (below this is a textbox and OK/Cancel buttons)

    This line is set as the criteria in qryJudgeType under one of my columns - cboJudgeType points to my OK button on frmJudgeType. But like I said, this doesn't appear at all when the frmJudgeType is ran on its own outside of the Navigation form.

    If I hit cancel on the Parameter Value popup, I get an error message that reads:

    Run-time error '2501':
    The OpenReport action was canceled.

    If I hit debug, Visual Basic appears shows my code to run the OK button, which reads:

    Private Sub cmdOK_Click()
    DoCmd.OpenReport "rptJudgeType", acViewReport <----This line is highlighted as containing an error


    DoCmd.Close acForm, "frmJudgeType"
    End Sub

    Any thoughts on how to fix this line so that the form works correctly within the Navigation form (assuming that really is the issue)? Also, any chance when the form *does* work correctly, the report could be embedded within the navigation form rather than opening in its own window?

    Thanks so much for any assistance, I haven't used Access much at all and what I have done has been the result of extensive googling so I hope my explanation makes some sense.

  2. #2
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,067
    I ran into the same issue Forms!frmJudgeType!cboJudgeType is the problem The correct syntax is 4 parts. forms!navigationform!subform!control

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The syntax to refer to the form changes when it is used as a subform:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    librarian is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    3
    Perfect, thanks so much for the help!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-10-2012, 03:44 AM
  2. Replies: 11
    Last Post: 12-08-2011, 05:31 PM
  3. Replies: 7
    Last Post: 11-16-2011, 01:22 PM
  4. Printing a report in a navigation form
    By DanKoz in forum Forms
    Replies: 2
    Last Post: 08-29-2011, 12:11 PM
  5. Opening Report From Form
    By injanib in forum Forms
    Replies: 4
    Last Post: 02-08-2011, 08:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums