I have a form which calls another form which then closes the original form when it loads. Except it doesn't. I am using the code
but I get the error "the expression you entered refers to an object that is closed or doesn't exist", although the first form does actually close at this point. If I comment the code out, I don't get the error but the first form doesn't close either. I have checked and there is only one instance of the code so it's not trying to do the same thing twice. Any ideas?
Code:
Private Sub Form_Load()
DoCmd.Close acForm, "NameOfFirstForm"
End Sub
but I get the error "the expression you entered refers to an object that is closed or doesn't exist", although the first form does actually close at this point. If I comment the code out, I don't get the error but the first form doesn't close either. I have checked and there is only one instance of the code so it's not trying to do the same thing twice. Any ideas?