Abby
Abby

Reputation: 93

Is it possible to use VBA Code as an action on a Textbox in SSRS

I have VB code in my SSRS report and it is calling dexterity to open a window. Is it possible to reference the code in an action on a textbox field? I would like the user to be able to click the field and it opens the window.

Dim GPApp As Object
Public Sub Main()
    'Create the GP application object
    GPApp = CreateObject("Dynamics.Application")
    On Error GoTo 0
    If GPApp Is Nothing Then
        MsgBox("Failed to create the application object")
    End If
End Sub


Public Sub Receipt_Click()
    Dim ErrVal As Integer
    Dim error_msg As String
    Dim GpApp As Object

    ErrVal = GpApp.ExecuteSanScript("open form POP_Inquiry_Receivings_Entry; set 'POP Receipt Number' of window POP_Inquiry_Receivings_Entry of form POP_Inquiry_Receivings_Entry to RCT19002;", error_msg)
    If ErrVal <> 0 Then
        'A compiler error occurred. Display the error.
        MsgBox(error_msg)
    End If
End Sub

Upvotes: 2

Views: 148

Answers (0)

Related Questions