web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

VBA modification error

(0) ShareShare
ReportReport
Posted on by

I've made this little modification to "Sales Documents Print Options" screen to default 'Currency to Print' to Originating.  This works and does what intend it to do.

Curr-to-print-code.JPG

But now, when I open 'Sales Transaction' Window and click on the print button (without opening any sales doc)  it brings up the Print options screen with a Run-time Error, below

1222.error.JPG

it says that we've set a default value to a disabled field. 

this is not a hindrance to day to day work but still is there a way to remove this ?

Thanks

*This post is locked for comments

I have the same question (0)
  • Tim Foster Profile Picture
    8,515 on at

    <Content Removed>

  • Suggested answer
    Almas Mahfooz Profile Picture
    11,009 User Group Leader on at

    Do you have Multicurrency Installed or not?

    Please reply this first and do not try to unlock /Enable any field which is locked by gp default procedures, it will mess up things.

  • Community Member Profile Picture
    on at

    yes we have multicurrency installed

  • Almas Mahfooz Profile Picture
    11,009 User Group Leader on at

    How you checked it?

  • Community Member Profile Picture
    on at

    I know for a fact that we use multi-currency  and we have it enabled

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,127 Most Valuable Professional on at

    Hi Sinnerv

    You can only change a value of a field that is editable.

    You might need to check if the field is enabled first and wrap your code with an If then Endif.

    If CurrencyToPrint.Enabled = True Then

     CurrencyToPrint.Value = 2

    EndIf

    David

    PS: You might want to use the AfterOpen event rather than AfterActivate. Activate occurs every time you click on the window after being on another window.

  • Tim Foster Profile Picture
    8,515 on at

    David has the correct answer here.  Sorry for my original answer.

    Tim

  • Community Member Profile Picture
    on at

    Thanks

    I figured this out :)

    works alright on AfterActivate, however I'll take your advice and change it to AfterOpen

    Cheers

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans