Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

vba button - added to print screen - fails in SL2011

(0) ShareShare
ReportReport
Posted on by 1,350

1. Just upgraded to SL2011 FP1, 2. Testing customized AP Voucher and Adjustment screen ( 03010) where we added a button to PRINT the AP Edit Report (03810) for this particular batch (the VBA is below), 3. Pressing button to print worked in SL7, FP1.  Now in SL2011 FP1 it results in error(s):

Crystal Report Windows Forms Viewer
The ) is missing.
Details: errorKind
Error in File 03810
....rpt: Error in formula Record Selection:
'({vr_03810_cRI_ID} = 4) AND (vr_03810.batnbr =064816)'
The ) is missing.
Details: errorKind
A resolution for this error was found:  In SL2011, it is necessaey to enclose the TableName.ColumnName in curly braces.  Example: {ARTran.Custid}Source: https://community.dynamics.com/product/sl/f/35/p/74955/137552.aspx

But now we get another error. This time is says:
Crystal Report Windows Forms Viewer
A string is required here.
Details: errorKind
Error in File 03810
....rpt: Error in formula Record Selection:
'({vr_03810_cRI_ID} = 4) AND ({vr_03810.batnbr} =064816)'
A string is required here.
Details: errorKind
This is the EXACT CODE from SL7 version that had worked:
Private Sub Button1_Click()
    BatchNbr = Trim(GetObjectValue("cbatnbr"))
    ParmStr = "ROI.EXE " & PRMSEP
    ParmStr = ParmStr & "03810/RUN" & PRMSEP
    ParmStr = ParmStr & "03810/FORMAT" & PRMSEP
    ParmStr = ParmStr & "vr_03810.batnbr =" & BatchNbr & "/WHERE" & PRMSEP
    ParmStr = ParmStr & "/PSCRN"
    serr1 = Launch(ParmStr, True, True, 0)
End Sub

*This post is locked for comments

  • Ram Peru Profile Picture
    2,830 on at
    Re: vba button - added to print screen - fails in SL2011

    Hello Dave ( RedStorm )

    you are always welcome.

    Thank you,

    Regards,

    Perumalsamy R

  • RedStorm Profile Picture
    1,350 on at
    Re: vba button - added to print screen - fails in SL2011

    Perumalsamy R:  You did it! :-)  Thank you for providing exactly what I needed.  This prints my report just like I needed.  Thank you, thank you, thank you!  Dave (RedStorm)

  • Suggested answer
    Ram Peru Profile Picture
    2,830 on at
    Re: vba button - added to print screen - fails in SL2011

    Hello RedStorm,

    Try this below code in your customization.This will solve your Error.

    Private Sub Button1_Click()

     

        BatchNbr = Trim(GetObjectValue("cbatnbr"))

        ParmStr = "ROI.EXE " & PRMSEP

        ParmStr = ParmStr & "03810/RUN" & PRMSEP

        ParmStr = ParmStr & "{vr_03810.batnbr} =" & Sparm(BatchNbr) & "/WHERE" & PRMSEP

        ParmStr = ParmStr & "/PSCRN"

        serr1 = Launch(ParmStr, True, True, 0)

    End Sub


    Thanks,

    Perumalsamy R


     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

#1
Community Member Profile Picture

Community Member 136

#2
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 102 Super User 2025 Season 1

#3
REUser Profile Picture

REUser 8

Featured topics

Product updates

Dynamics 365 release plans