开发者

Run Time Error '2501'

I'm having the Run Time Error '2501' on a Form. Does anyone have ideas of why this happens and how to fix it?

The Report is called through this code:

Private Sub Command92_Click()
    DoCmd.SetWarnings Off
    ''# get current reqid and version number
    DoCmd.OpenQuery "NewReqVersion", acViewNormal

    Dim NewReqID As Integer
    Dim NewVerID As Integer

    NewReqID = Me.Text58
    NewVerID = Me.Version + 1
    [Forms]![UWReviewForm].[StatusID] = 99
    On Error Resume Next
    **DoCmd.Save acForm, "UWReviewForm"**

    DoCmd.OpenForm "NewReqVersionForm", acNormal
    DoCmd.GoToRecord acDataForm, "NewReqVersionForm", acLast
End Sub

Private Sub StatusID_Change()
    Me.LastModifiedTimeStamp = Now()
End Su开发者_高级运维b


The error 2501 can occur on calling OpenForm if there is a problem with the database. Can you please try following the steps in the link below under the headings "Recovering from corruption" and "Symptom: Cannot open a form or report"?

MS Access - Recovering from corruption


In my case, I had a table linked to an external data source, which was another Access database. I had experimented with splitting that database application into its database component and UI component, and had decided to revert the change. Somewhere along the line, this corrupted to the link between my original Access application and the external Access data source. I could verify this by attempting to open the linked table in my original Access application, and it gave an error.

My solution was to delete the linked table from my Access application and import it once again. After this, my problem resolved. The forms which could not open before were based on queries which included this external data source.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜