I have a report whose fields are tied to fields in a form rather than a data source. In Access 2007 this works fine, but I
can't get it to work in the Access Runtime version. The report is canceled before it runs and though I am able to trap the
famous 2501 error I cannot seem to reverse the "Cancel Report" command. I have spent some time researching this issue, and
tried the various suggestions. I suppose I could change the routine to populate a data source before running the report but
I'd rather not go through that trouble unless I absolutely have to. The code is attached.
Private Sub Command34_Click()
On Error GoTo Err_Command34_ClickDim stDocName As String
Dim vMsg As Variant
Dim stLinkCriteria As String
If IsNull(ProjectNo) Or ProjectNo = "" ThenMsgBox "Please select a Project No."
stDocName = "LabelExpandable"
DoCmd.OpenReport stDocName, acViewNormal
If Err.Number = 2501 ThenMsgBox "Error 2501"
ElsevMsg = Str(Err.Number) & " > " & Err.Description