Hello,
I have a database with Access 2016 which frontend and backend splitted. I've put a print button inside a form which has a function to print a subform.
While I try to use this function from front end, it's working on .accdb and .accde versions of form, but when I try to use print function from access runtime version I'm getting below errors.
I'have tried to run by vba code and access macros and getting these errors still, is there any way to print forms from access runtime version?
Subform name : "frmDailySummaryLossSpreadsheet"
VBA Code:
Code:
Private Sub cmdprint_Click()
Dim stDocName As String
Dim MyForm As Form
On Error GoTo Err_SomeName
Application.Echo False
stDocName = "frmDailySummaryLossSpreadsheet"
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut acSelection
If Not SysCmd(acSysCmdRuntime) Then
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.RunCommand acCmdWindowHide
End If
'DoCmd.SelectObject acForm, MyForm.name, False
Application.Echo True
'error handler
Exit_SomeName:
Application.Echo True
Exit Sub
Err_SomeName:
Select Case Err.Number
Case 9999 ' Whatever number you anticipate.
Resume Next ' Use this to just ignore the line.
Case 999
Resume Exit_SomeName ' Use this to give up on the proc.
Case Else ' Any unexpected error.
Call LogError(Err.Number, Err.Description, "frmDailySummary_cmdprint_Click()")
Resume Exit_SomeName
End Select
End Sub