I get error code 2467 when trying to reference a subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    I get error code 2467 when trying to reference a subform

    I have a main form that has two subforms. In the main form's OnLoad event I have code that references both subforms to set their allow additions, edits, and deletions to true or false depending on certain criteria.
    Code:
    With Me.sfrmEarlyDisclosures.Form
        .AllowEdits = False
        .AllowAdditions = False
        .AllowDeletions = False
    End With
    
    With Me.sfrmAppraisals.Form
        .AllowEdits = False
        .AllowAdditions = False
        .AllowDeletions = False
    End With
    For some reason, I get error code 2467 - "The expression you entered refers to an object that is closed or doesn't exist" when running line 1, but not line 7. Neither subform has records (yet), so that isn't the difference. At first I thought that maybe the subforms didn't load until after the main form's OnLoad event, but then line 7 wouldn't work either. I'm not sure what else to look for setting wise to make it work.
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    UPDATE

    I did further testing and it still doesn't work (same error) in the main form's OnCurrent event.

    Comment

    • Seth Schrock
      Recognized Expert Specialist
      • Dec 2010
      • 2965

      #3
      Fixed it. I missed transferring that table over to the new BE. Since there was no recordsource for the form, it didn't load the form and therefore the .Form didn't exist.

      Comment

      Working...