run time error '2455' invalid reference to property form/report

MilaK

Registered User.
Local time
Yesterday, 23:29
Joined
Feb 9, 2015
Messages
285
Hello,

All of the sudden, the three bound subforms are not being recognized by the Parent form. I get an error message "run time error 2455 invalid reference to property to form/report".

I opened all of the forms and they populate on their own but do not work when bound to the Parent form.

What should I do?

Thanks
 
Last edited:
If this was all of a sudden then maybe something got corrupted. I suggest a compact and repair. If that doesn't do it then you may have to build a new main form. If you can upload the database?
 
How are they 'bound' to the Main Form...thru the Link Master/Link Child Fields or in some other way? And if the former way, do they still show that they are linked?

If it is corruption, it's worthwhile to try the old 'create a new file and Import everything into it' routine, which works a remarkable amount of the time.

Linq ;0)>
 
Yes, the master/child fields are still linked.
I have so many forms, tables and queries it will take me a long time to import everything into a new file. I've tried compact repair, but no luck.

Thanks
 
...I have so many forms, tables and queries it will take me a long time to import everything into a new file...

I always wondered about those raised eyebrows of yours, Allan! In this case they're definitely appropriate! :D
 
@Rural guy. I've just imported the whole database into a new file.
Unfortunately, I get the same error messages as before.

Thanks
 
Yes,


It stops here

Code:
With Me![frm_Fusions].Form
        .Visible = (.RecordsetClone.RecordCount > 0)
    End With

and tells me it doesn't recognize the subform "frm_Fusions".
 
I'm referencing the subform from a control event (AfterUpdate) of the main form, therefore, I don't think it's going to work.

I'm trying to determine if the record source is empty and if it is I want to hide the subform form.

This code was working at some point but now throwing error messages.

Code:
Private Sub cmb_samples_AfterUpdate()

    If IsNull(Me!cmb_samples) Then Exit Sub

    With Me.RecordsetClone
      '.FindFirst "[sample_id] = " & Me!cmb_samples
     .FindFirst "[sample_id] = """ & Me!cmb_samples & """"
      If Not .NoMatch Then
         If Me.Dirty Then Me.Dirty = False
         Me.Bookmark = .Bookmark
      Else
         ' put your not found code here, but you really shouldn't need it
      End If
    End With
  'hide fusion subform if no fusion present
  'If Me.CurrentView <> 1 Then
  With Me![frm_Fusions].Form
        .Visible = (.RecordsetClone.RecordCount > 0)
    End With
    Me!cmb_samples.SetFocus
  With Me![frm_Fusion_ExpressionControl].Form
        .Visible = (.RecordsetClone.RecordCount > 0)
    End With
    If Me![frm_Fusions].Form.Visible = False Then
    Me.lbl_scub.Caption = "** No Fusions Detected **"
    End If
    
    If Me![frm_Fusions].Form.Visible = True Then
    Me.lbl_scub.Caption = "** Fusion Detected **"
    End If
    
    If Me![frm_Fusion_ExpressionControl].Form.Visible = False Then
    Me.lbl_scub.Caption = "** RNA Assay Not Performed **"
    End If
    
    [Forms]![frm_Review_Fusions_total]![frm_fusion_reportable_comments].[Form].Visible = False
    'End If
End Sub
 
Me![frm_Fusions] references the Controls collection of the current form. If the SubFormControl, not the SubForm it displays, is not named "frm_Fusions" then it will throw that error.
 
Last edited:
I'm confused... please clarify how to reference the subform from the main form correctly.

What should I change my code to? Thanks
 
I guess I'll start by asking what is the Name of the SubFormControl? The SubFormControl displays a subform and has the LinkChild/MasterFields properties on the data tab. Its name is on the Other tab of that property sheet. Pardon me if I'm getting too basic.
 
"frm_Fusions" is the name of the control and also is the Source Object.
The linked field is named sample_id.
 
Try using the Dot "." instead of the Bang "!" in your syntax. The Bang is too smart.
With Me.frm_Fusions.Form
 
I've tried this:

Code:
With Me.frm_Fusions.Form
        .Visible = (.RecordsetClone.RecordCount > 0)
    End With

and get the same error message.
 

Users who are viewing this thread

Back
Top Bottom