Share via

error setting RecordSource to Form

Anonymous
2011-09-16T18:09:45+00:00

I have a form that has a button that opens another form.  In the form that is being called to open.  I try to set the Recordset and I get an error msg.

In the "On Open" of the form that is being called to open, I have this line below.  It is being applied to a subform in that form.

        Forms![Frm_EmailViewerUpdate].[frm_EmailViewerUpdate subform].Form.RecordSource = ""

        Call SQL_PassThrough(strConnection, strSQLGUID, strLinkedTableName)

        Forms![Frm_EmailViewerUpdate].[frm_EmailViewerUpdate subform].Form.RecordSource = strLinkedTableName

Error msg I get is :

Run-time error '2467':

The expression you entered refers to an object that is closed or doesn't exist.

I tried putting my code in the "on load" and I get the same error msg.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-09-16T19:21:59+00:00

I moved the following lines to the "on Corrent" and it is fine now.

Forms![Frm_EmailViewerUpdate].[frm_EmailViewerUpdate subform].Form.RecordSource = ""

Forms![Frm_EmailViewerUpdate].[frm_EmailViewerUpdate subform].Form.RecordSource = strLinkedTableName

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2011-09-23T07:44:51+00:00

    Thanks for the update.

    Was this answer helpful?

    0 comments No comments