web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: VBA modification error

    <Content Removed>

  • Suggested answer
    Almas Mahfooz Profile Picture
    11,009 User Group Leader on at
    RE: VBA modification error

    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
    RE: VBA modification error

    yes we have multicurrency installed

  • Almas Mahfooz Profile Picture
    11,009 User Group Leader on at
    RE: VBA modification error

    How you checked it?

  • Community Member Profile Picture
    on at
    RE: VBA modification error

    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,069 Most Valuable Professional on at
    RE: VBA modification error

    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
    RE: VBA modification error

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

    Tim

  • Community Member Profile Picture
    on at
    RE: VBA modification error

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans