locked
Run-time error "2450" Application cannot find form (form is a subform in navigation form) in MS Access 2010 database RRS feed

  • Question

  • Hello All,

    I have a frmCategories which is a subform of a navigation form called frmMainNavigation form. This frmCategories form contains (i) a Category combo-box - to select a category (ii) 2 unbound fields for Start Date and End Date  (iii) Option Group called Dates which contains option buttons Purchase Date and Sale Date and (iv) Option Group called Images which contains option button Print Images and No Images. Selection from these multi-select criteria will allow a user to run a report.

    if a user selects a Category from the combo-box, a date range (from the Start Date and End Date unbound fields), Purchase Date (option button) and no images (no option button), and then click run report, a debugging error message occurs:-

    Run-time error '2450'

    Microsoft Access cannot find the referenced form 'frmCategories.' When I debug this error message, this line of code is highlighted in the rptReportByCategoryNoImag report:

    Me.Text14 = Forms!frmCategories!TxtStartDate

    from this expression in the rptReportByCategoryNoImag report:

    Option Compare Database
    Option Explicit
    Private Sub Report_Load()
        Me.Text14 = Forms!frmCategories!TxtStartDate
        Me.Text15 = Forms!frmCategories!TxtEndDate
    End Sub
    From my readings from the web, I see that the problem has to do with Access not being able to locate the subform in the Navigation Form and in order to reference the subform, I will have to point the direct path of the subform in the navigation form:- Forms![frmMainNavigation]![Child8].Form![Child3]. My question is what do I do next?

    Sunday, January 28, 2018 1:46 AM

Answers

  • Hi wirejp,

    From your Description It looks like you want to Reference the Textbox value from Navigation form to your Report.

    Try to refer example below.

    Code on Report Load Event:

    Private Sub Report_Load()
    Me.Text0.Value = Forms![Navigation Form].NavigationSubform.Form.Text2
    Me.Text2.Value = Forms![Navigation Form].NavigationSubform.Form.Text4
    End Sub
    

    Output:

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 29, 2018 8:52 AM